Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Ghosu on February 21, 2016, 04:37:41 AM

Title: Arcade Racer: direct contols and physics?
Post by: Ghosu on February 21, 2016, 04:37:41 AM
Hi folks

Currently i'm working on some kind of racing game using Playmaker...and my biggest problem right now is to get the controls right. It's arcade style and movement will be direct, so when i move the joystick to the left the car should move directly there (not like forward=accelerate, backwards=brake,left/right = steering). I'm quite happy with the current controls, though i don't get it to work with physics.

There will be plenty physics in the game like jumping over ramps, colliding with other players or objects, get hit by stuff and whatever. I tried several methods, atm i'm using method B on this screenshot in combination with the smooth look at direction action.

(http://666kb.com/i/d6l7k57epa8wr9fj8.jpg)

PROTOTYPE VIDEO:
Though, the problem is: the smooth look at action locks the rotation of my game object, in the video's first segment right after the steering test i click on the car to apply a force - it just "jumps" without any kind of rotation, same when i drive over a ramp with upwards angle - ofc the look direction doesn't change. I guess this can be fixed if i use something like raycasts and normal check to adjust rotation - but the problem with physics not interacting with rotation will still remain.

Maybe use just a rotate action to rotate a single axis to adjust direction and fix the tilt rotation for ramps with raycasts...there must be a better way?

In the second part of the prototype video i'm using wheel colliders to control both cars - works just fine and can be adjusted to feel like arcade i guess. Though no direct contols, left/right is for steering so this would need adjustment. But using a rigidbody with forces still feels a bit better...so, any helpful ideas?

Thanks and have a nice weekend,
Matthias
Title: Re: Arcade Racer: direct contols and physics?
Post by: Ghosu on February 24, 2016, 02:04:03 AM
... like this:
Title: Re: Arcade Racer: direct contols and physics?
Post by: Ghosu on February 27, 2016, 01:38:57 PM
Managed to get what i want...at least the base is finished, needs some bugfixing and tweaking but it should work. Physics based control only, using side forces to rotate the rigidybody - direct controls, car drives to the controller axis direction. No look at function that locks rotation any more so the car interacts with colliders all the time.


greetings
Title: Re: Arcade Racer: direct contols and physics?
Post by: djaydino on February 28, 2016, 12:42:58 PM
Hi,
Your Prototype video looks very promising and i am happy you managed to get what you want and share it with us :)

Would it be possible to share a sample project on how you have set this up, or make a video of it?