Ask here your questions to get help using GDevelop.
User avatar
By ThePaperComet
#62242 I would like to create a car racing game where the car always faces to the right (so you see a side on view) and moves over land/platforms. What I can not seem to figure out is the movement combination. I can create the character as a platform char so it can jump and move etc, however the char is always horizontal and does not change angle with the slope of the platforms. I have tried changing the collision points on both the char and the platform. I have added physics but that doesn't seem to do it. I am sure the answer is simple but it is alluding me :? :? :? Any ideas how I could do this?
By MattLB
#62284 Not tested, but you could maybe create an invisible "bumper" object that you position at a point right at the front of the car to detect the slope. If this bumper object is in collision with the ground object then you apply an anti-clockwise rotation to the car object. You will have to shift the centre of the car object to near the back wheel so that the rotation doesn't push the back end into the ground.

This will only work going up a slope, so you'll need another invisible object positioned below the front of the car to rotate it clockwise when it *isn't* in collision with the ground object so that it faces down slopes.
User avatar
By Lizard-13
#62290 For a car game I would use pure physics, platformer behavior has fixed angles and is not "real" physics at all, so you end trying to simulate physics bahaviors when you have this already out of the box in another extension :)

There was a post some years ago from victor with a nice car example, I can't find it so I made a new one:
(40.39 KiB) Downloaded 129 times