- Home /
How Do I: Make a 2D sprite that is bouncing move horizontally relative to the position of the platform?
As a beginner to Unity, I find some aspects very easy to grasp, and some aspects very hard to grasp. What I do understand is how to set up a scene and create objects and add the components I need. In the current setup I do have, there is a sprite that has a bounce component along with a collider that collides on the platform I want to control. The platform won't have any vertical component, just a horizontal component to control. Now, when the sprite falls onto the platform, it will bounce up the same height as it fell with no friction, and continue doing that until it doesn't hit the platform. The idea I'm trying to figure out is when the sprite doesn't fall exactly in the middle of the platform, maybe left or maybe right of it, the sprite should have a horizontal component relative to how far left or right it goes. If the sprite falls far right of the platform, but still hits it, the sprite should travel up, but also travel to the right, vice versa for the left. What would be the easiest way to implement this into a C# script? Thank you for your help :D
Your answer
Follow this Question
Related Questions
Positioning Objects in a 2D Project 2 Answers
When an object bounces between two bouncy objects it goes through them 1 Answer
i need help about players hands positions in 2D multiplayer card game 0 Answers
Disable/Change gravity effects on inclined platforms 2 Answers
Why does my character fall through the floor after I've moved it? 0 Answers