BioMotionLab / TUX

A framework for experiments in Unity and VR
https://biomotionlab.github.io/TUX/
Other
29 stars 4 forks source link

problem with trial blocks #71

Closed Tomaso-Zanardi closed 1 year ago

Tomaso-Zanardi commented 1 year ago

Hi, I am using bmlTUX to make my first experiment, I finished coding everything, and the only issue is now to develop a practice block. basically, I wanted to create some trials for a trial block to give participant some familiarity with the task. To do that I thought about modifying the Block class adding something to the block class.

to create the block I used some nested loops, and called my custom PracticeBlock() method in the PreCoroutine() method.

The problem seem to be with participant inputs: as soon as I add any line regarding participants inputting anything to respond to stimuli, the scene freezes after being played.

Do you have any suggestion or solution for this problem?

Thanks in advance.

AdamBebko commented 1 year ago

Hello! I think you need to provide more details and maybe some code. Otherwise, it could be a very large range of possible issues.

Tomaso-Zanardi commented 1 year ago

So, basically I wanted to create a trial block, outside of the trial structure provided by bmlTUX.

in order to do that I thought to implement some sort of while structure in the PreCoroutine() in the block class, like so:

Screenshot 2023-07-04 150137

Screenshot 2023-07-04 150224

the problem is that as soon as I introduce the possibility for participants to input their reaction to a stimulus through the keyboard, that is enough to block the scene. In my case the sheer presence of this:

Screenshot 2023-07-04 150243

freezes unity completely.

AdamBebko commented 1 year ago

Hi Tomaso,I think the issue lies with using Async. Unity doesn’t behave nicely with async. I would recommend that you use a coroutine or event architecture instead. I’m 99% sure this is not a BMLTUX problem but an issue with the way you’re calling the code. AdamSent from my iPhoneOn Jul 4, 2023, at 9:10 AM, Tomaso Zanardi @.***> wrote: So, basically I wanted to create a trial block, outside of the trial structure provided by bmlTUX. in order to do that I thought to implement some sort of while structure in the PreCoroutine() in the block class, like so:

the problem is that as soon as I introduce the possibility for participants to input their reaction to a stimulus through the keyboard, that is enough to block the scene. In my case the sheer presence of this:

freezes unity completely.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Tomaso-Zanardi commented 1 year ago

I think I might have found a workaround, therefore this issue could be closed.

I am facing some other problem, given that I have to make a webgl build of this experiment, for an online version of it. Should I open a separate issue, or should I ask you about it here?

By the way, I want to thank you for your support. I am sorry to bother, I am just very inexperienced with this technology, and I am trying to learn while making my first experiment. Therefore, thank you again.

AdamBebko commented 1 year ago

No problem at all. WebGL is currently completely untested although I do recall another user using it at some point. I won’t be able to help out on that front unfortunately. AdamSent from my iPhoneOn Jul 6, 2023, at 12:23 PM, Tomaso Zanardi @.***> wrote: I think I might have found a workaround, therefore this issue could be closed. I am facing some other problem, given that I have to make a webgl build of this experiment, for an online version of it. Should I open a separate issue, or should I ask you about it here? By the way, I want to thank you for your support. I am sorry to bother, I am just very inexperienced with this technology, and I am trying to learn while making my first experiment. Therefore, thank you again.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>