fail to achieve bounce using return, update not running function

fail to achieve bounce using return, update not running function
No description
4 Replies
mtreit
mtreit2d ago
You might ask in #game-dev since it's Unity. I'm not quite sure what you're asking.
Nasdack
Nasdack20h ago
1) Attach a Rigidbody instead, and use AddForce; docs, 2) Consequently, you should use FixedUpdate, and not Update here 3) Your current setup only executes the two functions once as the second time it is executed, for example x, -0.09f (reversed from the first run) + -3.01f equals -3.19f, hitting your return statement.
Safwan Ahmad Khan
Safwan Ahmad KhanOP12h ago
thanks for your suggestions. I am still learning.

Did you find this page helpful?