Hello
Someone asks me, how to create a car at right side next to player. So i just wrote this little tutorial about. I hope you enjoy this little thing, which was did in two hours, and explained with a horrible english ;D
Spend time:
2 hours testing the spawn of vehicles and coding + doc
3 hours making this tutorial with translation
0.5 hours thinking about, why i am doing this ... (i didn't found an answer -.-)
First we have to know some things:
How is the World working
How is the Position working
How is the Rotation working
How can i spawn a car (Code snippet)
How is the World working? => It is a north axis oriented map. If you open the full map ingame, top is north, bottom is south. It is every time a constant and will not change
How is the Position working? => It is a Vector based information. It has three types.
X => left - | + right
Y => top - | + bottom
Z => down - | + up
The "+" and "-" are the operators here in our coordination system, which we have to use later.
How is the Rotation working? => It is a Vector based information. Same here we have three types, but the number is always positive. So we can just use the Z variable.
X => back | front (Not tested)
Y => left | right (Not tested)
Z => ground
Then we will get four options:
N => 0°
E => 270°
S => 180°
W => 90°
We have to use the radius to know how the player is rotated away from north.
Just think about your shool days. back then you had geometry and raius was a topic of it.
Ok, we got our information. Let us code that stuff
Small version
Doc version