Question by
BoydT44 · Nov 13, 2015 at 06:00 PM ·
javascriptphysics2dsprites
How to make sprites bounce?
Hi, I'm making a 2d game, colliders and rigidbody's are all in 2D also and I work in javascript. So I have a stationary sprite (is kinematic) at the centre of the screen and my other sprite travels towards the stationary sprite using:
transform.position = Vector3.MoveTowards(transform.position, Vector3(0,0,0), Time.deltaTime * mySpeed)
each sprite has the physics 2d material with 0 friction and 1 bounciness. When they collide I made it so it stops moving towards the stationary sprite. It doesn't bounce so not really sure what to do so I posted here, thanks for your help.
Comment
Your answer
Follow this Question
Related Questions
Making my variable global. 1 Answer
Best way to create 2D tiled sprite. (UnityScript) 1 Answer
How get position from a game object? 5 Answers