In my most recent project, I am re-creating certain aspects of the game Pro Gymnast which simulates… gymnastics and have run into an issue that prevents me from working on one of the main features of the game, the trampoline.
When doing flips in the game you simply hold a button to tuck in. The character goes moves on a 2d plane (x, y) while the rest of the game is 3d. I simply cannot find a way to keep the part(in my case) from tipping to the left or right and falling off.
issue of part falling off to the left
What I am attempting to do:
My current code is:
while true do local x = script.Parent.Position.X local y = script.Parent.Position.Y local z = 3 --where the part is locked to for the z axis wait(.01) script.Parent.Position = Vector3.new(x,y,z) end
I don’t know much about this and how to go about fixing it so I would appreciate some help. Thanks!