User mini profile

- Thu 15 Jun 2017, 04:46#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?

User mini profile

- Sat 17 Jun 2017, 21:40#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 mini profile

- Sun 18 Jun 2017, 08:06#62286
Ooo thats another way to do it. I was trying something similar today by making a dozen different slopes out of a bar and using a block to match the slope Still a little jerky in the movement but it has possibilities.

User mini profile

- Sun 18 Jun 2017, 17:00#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: