side scrolling car physics

For questions about using Classic.

Post » Sun Oct 07, 2012 10:29 am

I wanted to make a 2d car with physics behaviour which would roll down a slope. I made a car body with physics enabled and 2 wheel objects also with physics enabled. I added the two wheels to two differant image points on the car body. When I run the game, the car flies upwards instead of rolling down th slope. Please help. At least point me to a topic for this issue and I shall be grateful. Please suggest if you need a cap posted here.   

PS : I had posted this in a differant forum earlier. Please bear with me as I am new to forums and will sonn pick up the etiquete
B
2
Posts: 5
Reputation: 260

Post » Sat Oct 13, 2012 9:29 am

Some help please...Anyone?
B
2
Posts: 5
Reputation: 260

Post » Sat Oct 13, 2012 2:49 pm

Ah, to position physics objects you need to disable the physics behavior, move them, and then enable the behavior, and set the velocities to 0.

This doesn't work in your case though, as you want the wheels to move the car body. In that case you'll probably need to create a physics joint/hinge between them but I'm not quite sure how that is done exactly.

Your method would work in reverse for a one-wheeled/physics body object though, where you can position the non-physics object to the physics objects image point and it shouldn't glitch.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sat Oct 20, 2012 5:15 am

Thank you for the reply , but I did not really understand this... I am working around it by adding a rotation behaviour to the wheels, and physics behaviour o the car body. It is a woeful workaround, but with carful timing I am managing it for now.
B
2
Posts: 5
Reputation: 260

Post » Mon Oct 22, 2012 6:21 pm

hi. im not sure if i understood correctly, but anyway, i threw together a little example .cap for a 2d car physics, or at least one way of doing it. its just a barebones example with only a few events. you could add alot of things to it, like subtle steering while on air and stuff like that,also you can tinker with bounciness and traction and stuff to your liking,just have to experiment with the physics behavior. hope it helps even if just a little.

grab the .cap here:

http://dl.dropbox.com/u/11157144/2d-car-physics.cap
B
4
S
2
G
2
Posts: 109
Reputation: 1,318


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests