- Home /
Is there any function works like LateFixedUpdate?
hello,
i want to visualize rigidbody movements(a balls movements,say) by non-rigidbody line rendered vectors.
simply, vectors track ball' s position and direction in lateupdate(since vectors are not rigidbody). im using balls.transform.hasChanged flag to detect if the ball is moving.
ball is controlled in fixedUpdate as it is rigidbody.
I reset the hasChanged flag in the lateUpdate. (to be sure every vectors update function is completed before reseting flag).
code looks working but theoretically fixedUpdates called more rapid than updates, so vectors might not be tracking ball in some fixedupdates.
how can i be sure that vectors are allways reacting to balls transform changes instantly?
//this is a vector instance's sample code, i have a bunch of vectors enabled. update() { if(rigidBalls.transform.hasChanged) //go track the ball, point to some directions, etc } lateUpdate() {//all updates finished, reseting the flag rigidBalls.transform.hasChanged=false; }
Your answer
Follow this Question
Related Questions
How often does the internal physics calculation get called? 1 Answer
Input and applying physics, Update or FixedUpdate? 3 Answers
Rigidbody character and Update() function 1 Answer
When exactly is OnStateUpdate called for different AnimatorUpdateMode-s? 1 Answer
Framerate independent physics (FixedTimestep, FixedDeltaTime) 1 Answer