Jump to content


Photo

Topdown car physics in GM:Studio


  • Please log in to reply
No replies to this topic

#1 dark_master4

dark_master4

    GMC Member

  • GMC Member
  • 1176 posts
  • Version:GM:Studio

Posted 03 August 2012 - 03:25 PM

NEW PROBLEM

I have the car working, lateral velocity of the wheels killed, but now when I apply force to the wheel so they can move, they go maximum 1 pixel per second so the car ends up being REALLY slow AND when I turn the front wheels, only them slow down, with the rear wheels keeping their power. It's like once I apply the force, it never wears off unless I apply another force _directly_ on the wheels themselves.

Here's the GMZ -> https://dl.dropbox.c...Brain inDev.gmz

Control with W and mouse to steer.

Edit: Solved. People, don't use distance joints if you don't want distance between two objects. Box2D documented it well, but it's not in the GM:S manual. Use revolute instead.

OLD TOPIC

So I'm playing around with the Box2D engine in Studio and decided to try a topdown car. It's acting REALLY weird. The car just starts doing 360°s and when I release W, it still gets power. What am I doing wrong?

Edit: I think what I'm doing wrong is the vector math. I need to find what the sideway velocity of each wheel is and negate it using an impulse but I'm pretty sure I got the maths wrong.

Edit2: Here. That's what the problem really is: I need to solve the purple arrow's length. I have the blue and the red arrow.
Posted Image

Edit3: Solved. This was my solution:
Posted Image

Edited by dark_master4, 04 August 2012 - 10:15 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users