- Home /
2D Platformer - Jump on platforms in Background
I posted this in the Scripting section of the forum but figured it will get noticed more here.
I've done some searching but so far everything I found doesn't seem to apply to what I'm looking for. All of the one way platform information that I've found on here has been very useful and will be very helpful for when we do implement them. But what I'm looking to do is to be able to jump on platforms that are in the background. There are a few sections where the player can take two routes. Either take a slightly easier way (the background) or keep on the path in the foreground. Below I've attached what I am talking about. Don't mind the models/textures I have in right now, they are placeholders for the time being. Any help on this is greatly appreciated.
Is there something preventing you from implementing the z axis?
The question is how do I get the character to jump on the platforms in the background. But there was a suggestion made by Joshua that I didn't even think of because I was racking my brain so hard at something so simple.
Answer by Joshua · Mar 03, 2011 at 04:07 AM
I'm assuming you have set it up that the player can only move in one direction, let's say it's the z axis. At certain platforms you want to enable movement in the x axis too though. My idea would be to make those platforms a trigger, and then in your script when it's triggered enable movement in the z axis. But you're not showing me any code, so I have no idea if this is helpful.
I mean, unity is a 3d game - you must've disabled movement in one of those dimensions for the 2d platformer to work. Now just don't disable that at certain points and you're done.
It's based off of the 2D Platformer Tutorial that the Unity Team themselves provided. Basically I'm taking what I learned from there and applying it to my own game. But to be honest, I didn't even think of that truthfully. I'll give it a shot! Thanks!
I should also note it's actually the player is running along the X axis and he needs access to the Z-axis. So I would have to enable movement through a trigger to the Z-Axis.
Your answer
Follow this Question
Related Questions
2D platformer jumping that feels good 1 Answer
I am having issues with my Jumping Script. 2 Answers
Top-Down Jumping (2D) 1 Answer
2D Sidescroller enemy AI jump help! Picture Included! 3 Answers
How to jump in 2D? 1 Answer