![]() |
Car drifting
How does the drifting for the cars on UN work? In other words, how would I make drifting for a car script that I have. It moves in the 360 degree direction that changes to the arrow key direction. How does drifting work in general?
EDIT: btw, I am willing to post parts of my script if it helps... |
Would be much the same as an ice skating rink script. I can provide a GS1 example though I'm not sure how useful that would be. PM me if you would like it.
|
Thanks, im better with gs1
|
they got drifting on un? if so i should play there all day :P
|
Quote:
|
What do you mean by drifting?
|
they have drifting? wtf?
|
not really drifting but what I mean is, when you are giong in one direction but turn to A different one really quick, you still move in the other direction a little bit with inertia.
|
Quote:
|
360 degree
Quote:
|
right, I already know that, my car script can move in 360 degrees with some pretty good collision detection. I just chose to limit it to 8 or 4 directions like UN.
|
you made it like, when pressing left or right, angle++/-- and then up is acceleration and down is brake?
|
Well, you'll want to have two variables: xvelocity and yvelocity
While the car is moving, you'll increase the x/y by xvelocity and yvelocity. When you press the up key, you'll decrease y velocity by the acceleration until it reaches the speed limit. When it reaches the speed limit, it stops increasing the velocity. Do the same for the other keys. PHP Code:
|
that Script looks good :) well you only miss one thing :O
setTimer(0.05); in timeout and/or in onCreated()? or not needed? :confused: |
I didn't give the full script, I just gave a general idea of how to do it.
|
ah, I was wondreing, because I know you can script :P
^^ |
Quote:
Quote:
|
It wouldn't surprise me if the "drift" was caused by bad scripting =p
|
Quote:
|
| All times are GMT +2. The time now is 12:59 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.