- Solved - Car turning

Hi

Newbie here, I tried to understand how that example “RacingGame” was done, but didnt really get that turning thing.

I try make test, where car have force already at beginning. and player just turn it and try to park it.
I manage to give it force, and it rotate, but not to make turn it and change direction of movement same time, where car is heading, well like car normally do. :slight_smile:
How to do it like in that “RacingGame”-example?

Regards
Markus

Its simply done by changing the direction of the car whenever the Right or Left button is clicked!
When changing direction in GDevelop, the sprite also rotates

Thank you for reply, I get that turn, here couple image if it make more clear, what i´m looking for and what i´ve done…

events:

Car should move which way i turn, well… like a car do :stuck_out_tongue:

Are you from croatia, as you say “auto” thats exactly how I say it.
Also, try using Forces not torque.

Don’t use the physic behavior to just rotate your object. You just need the actions in “All objects > Angle” category to rotate the car.

Heh, I´m from Finland, yes, “auto” means car here :slight_smile:
Thanks for replies and help, but it doing same. Maybe there should some, that change force where car is pointing. But as newbie I dont figure out how…

Here new screncapure of events:

Hi!
Try this:

Thank you! Closer, closer! :smiley: But I like to be it, like that car moves automatically, so player cant stop it. It just moves from beginning, and then player should stop at right time in parking spot (pressing example “s”-key).

delete that “w” key is pressed condition :smiley: That’s how car moves all the time. Or you can change “w” key is pressed to “begin of the scene” like you have already and change damping to 1 too :slight_smile: Tai sanotaan vaikka näin, että sinun ei tarvitse muuttaa mitään muuta noista sinun eventeistä kuin tuo Add Auto a force, angel 0 tähän: Add Auto a force, angle Auto.Angle() :smiley:

Tried that, didnt work. When there´s that “auto is stopped” condition for turning. And if I delete that, it´s same like at beginning. :smiley: :neutral_face:

This will work! :smiley: Damping is 0.

Why mine doesnt…? :frowning: Should I do something with that variable, more than just add it?
Car not moving… :frowning:

What that variable do? As newbie really understand yet those variables and how they works.

It should work… Hmm. Look at those pictures and check is everything the same as mine. When you press “s” key just make variable “liikkuu” =1.


Sorry, my mistake! Didnt notice that variable at first line, so I got still that “At the beginning of the scene”!

Oh man, thank you you´re the best! :smiley:

regards
Markus

Hehehe :smiley: No problem, I’m glad I was able to help :slight_smile: