Creating ‘Staircase-Method’ Block/Trial Type #111
              
                Unanswered
              
          
                  
                    
                      kaitlin-grace
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 1 comment
-
| There are a few ways, but I think this is the way I would recommend: When you end your trial, you can take the result and the distance for this trial: bool hit = (bool) trial.result["hit"];
float distance= trial.settings.GetFloat("distance");calculate the new distance based on result, and previous distance. The  float newDistance;
if (hit)
{
    newDistance =distance + 0.1f;
}
else
{
    newDistance = distance - 0.1f;
}Then grab the reference to the next trial: Trial nextTrial  = session.NextTrialThen assign the calculated value to the nextTrial nextTrial.settings.SetValue("distance", newDistance);Then in your code, of course you can just use the distance value to position your GameObject. Additionally, you will need to make sure the distance is assigned on the very first trial. | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there! I’m aiming to remake a traditional psychophysics experiment in unity with the help of your awesome VR package!
I’m wondering if it’s possible to implement a staircase block design. On trials where the participant scores a ‘hit’, I want the distance between GameObjects to become further apart on the next trial. On trials where they score a ‘miss’, I want the distance between GameObjects on my next trial to be shorter.
Could I go about this by assigning distance between GameObjects as an additional independent variable? Or should I program this using coroutines?
If you have any ideas for how/if I could code something like this using UXF, please let me know! And again- thank you for your awesome experimental framework!
Beta Was this translation helpful? Give feedback.
All reactions