You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should add a section to the Physics manual to show how to subscribe to the physics tick events in order to mimic what people are used to for FixedUpdate.
using Stride.Engine;using Stride.Physics;publicclassFixedUpdate:StartupScript{publicoverridevoidStart(){varsim=this.GetSimulation();
sim.PreTick +=Sim_PreTick;
sim.PostTick +=Sim_PostTick;}privatevoidSim_PreTick(Simulationsender,floattick){// Run before the Simulation is updated}privatevoidSim_PostTick(Simulationsender,floattick){// Run after the Simulation is updated}publicoverridevoidCancel(){varsim=this.GetSimulation();
sim.PreTick -=Sim_PreTick;
sim.PostTick -=Sim_PostTick;}}
This should be a pretty simple manual page I think but we should also add it to the Stride for Unity® developers somewhere that would mention FixedUpdate from Unity.
more things to think about:
The Bepu physics implementation does not have these events. This will be a Bullet physics doc.
C# events kind of suck for performance apparently. Maybe we should give an example on how to make a single event call that can call multiple scripts with some sort of custom processor?
Maybe for Bepu we can show how to use the SimulationUpdateComponent which works very similar to Unitys Monobehaviour with the Fixedupdate replaced by SimulationUpdate and AfterSimulationUpdate methods.
The text was updated successfully, but these errors were encountered:
We should add a section to the Physics manual to show how to subscribe to the physics tick events in order to mimic what people are used to for
FixedUpdate
.Example:
This should be a pretty simple manual page I think but we should also add it to the Stride for Unity® developers somewhere that would mention
FixedUpdate
from Unity.more things to think about:
SimulationUpdateComponent
which works very similar to Unitys Monobehaviour with theFixedupdate
replaced bySimulationUpdate
andAfterSimulationUpdate
methods.The text was updated successfully, but these errors were encountered: