Acceleration.
#1

Again, this is me with another weird sin tan cos thingy.
I'm in a vehicle*.
I want to do this:

I have 2 coords, 1 coord which i will choose later, and the vehicle pos
Then i want to Set the vehicle velocity so, that it goes straight to my coord.

Yes, Vehicle, cause SetPlayerVelocity Sucks.
thx
Reply
#2

If you want it to go straight to it, why not just use SetVehiclePos? Because this way if there are objects in the way the car would explode.
Reply
#3

Quote:
Originally Posted by randomkid88
Посмотреть сообщение
If you want it to go straight to it, why not just use SetVehiclePos? Because this way if there are objects in the way the car would explode.
"Sigh"

Maybe because im making something with which i would like to use SetVehicleVelocity, because i'm not trying to set the pos to somewhere i'm wanting to launch him somewhere.
Reply
#4

Bump. Anyone?
Reply
#5

Bump. Sorry guys, been a week.
Reply
#6

Код:
Slowdown=100
DeltaPosX=XA-XB
DeltaPosY=YA-YB
Angle=-(90+(atan2(YA-YB,XA-XB)))
Radius=floatsqroot((DeltaPosX*DeltaPosX)+(DeltaPosZ*DeltaPosZ))
maybe some of this shit helps you. at least it works in my oject editor..
to get your vehicle accelration speeds, you should divide the Radius with a pretty high value, thats the Slowdown=100 for, maybe increasing it upto Slowdown=1000 helps, if your coordinates are far away. the result of Raduis/Slowdown should get you a value for the speed (like 2, 3, or even 4?). you know that i guess
Код:
VehicleAccX=Radius/Slowdown*floatsin(Angle-DeltaPosX,degrees)
VehicleAccY=Radius/Slowdown*floatcos(Angle-DeltaPosX,degrees)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)