- Home /
Ask for trigger-collision inside Update()
Hi there!
I am making a 2D game, where a paperplane gets influenced by windzones while flying. I didn't use any unity physics for that, except for some colliders, that are triggering if the paperplane is inside a windzone. It is very important for the game, that the flight curve is exactly the same, everytime I run it.
My problem is the following: If the framerate changes, also the flyingcurve changes, because OnTriggerStay2D is called sometimes more often and sometimes less then the update function. I guess this is because OnTriggerStay2D is called at the FixedUpdate Framerate, while the update its framerate varies. I tried to make my logic inside the FixedUpdate. This worked, but it extremely drops down the framerate.
There are two solutions, I could imagine:
Get Update and FixedUpdated to work one after another, so that there is always exact one FixedUpdate between two Updates.
Anyhow asking inside the update for all colliding triggers. (I thought about making a list, that updates everytime, the plane enters/exits a trigger, but this could also lead to wrong behaviour).
I hope anyone can help me!
Answer by CaKeMeaT · May 28, 2015 at 10:06 PM
ImportantNumbersLikeSpeed * Time.deltaTime;
I think you didn't understand my question. Using deltaTime would make it even worse. It does also influence the flying curve, because the time between the frames is always different. I need to be exact.