Cylinder race track
Hello. I want to make a game in which the player rotates along the inside of a cylinder and moves forward along its lenght. How can I make a blueprint for that, or what tutorial/s should i follow? A good example of what I want to do is a level in the old game Jak3 where you have to get back to the city. Thank you.
asked Oct 19 '18 at 12:21 PM in Blueprint Scripting
The cheap way: Use a SpringArm and attach your player, then rotate the SpringArm and move it along X or Y for forward/backward.
Or you code the math yourself, which is nothing more than 'Polar Coordinates'. You can have a value from 0-360 and if you press left/right you increase/decrease the value and with the help of the Polar Coordinates Formula you get your x and y values on the circle. Then again move it along X or Y for forward/backward.
Would be great to hear if this method worked out for you :)
If the car doesn't need to actually physics-wise interact with the track (only needs to know when it hits powerups and boost pads or enemies etc), then yes you could do this the way I did in an old pseudo 3D game I made many years ago in the style of Gyruss, where the X coordinate is cos(angle)*radius, where radius is the desired distance from center of the tunnel, and y is similarly sin(angle)*radius, and all you have to do is increase or decrease angle by pressing D and A.
This approach can work if the tunnel will always and at all points along its length, be the same width.
I wonder if the source code for S.T.U.N. Runner is available to look at?
answered Oct 19 '18 at 09:24 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here