commands to function fixed update

i asked this a while ago but never got an answer

i was basically wandering how i go out about applying physics in a fixed update from a gui touch?

so say i press my gui and a wheel spins around

at the moment i have both in fixed update bu i have heard that the input should be in an update and the action should be in a fixed update. i can understand why but how do i go about doing this.

do i make seperate booleans for each to check so say i press my gui and boo = true and in the fixed if boo == to true then do something

any help on how this is to be done correctly would be great

Sounds like you have the basic idea down:

You can capture user input in OnGUI(), including whatever data you’ll need to create your desired behavior (this may be a simple boolean – “button was clicked!” – but could be more complex depending on what exactly you’re trying to do).

Soon after that, Update() or FixedUpdate() recognize and handle the incoming data. You may also want some way to indicate that this has been done, perhaps so that your UI can refresh some value, or so that the behavior only fires once.

It’s not actually all that different from doing all of this in one function. The main difference is that you’ve separated input from implementation, and need some extra variables or objects to enable communication between the two.