R= enter car when touching car and doors are open.
Wsad = move player
Wsad = throttle for car
Q (open doors) + E= Exit car when doors are open.
Sets properties in player - Car=Vehicle GameObject, On=False
Sets properties in car = Rider = player gameObject, On=True
Moves the player to car[‘Seat’] gameObject
Parents player.parent to car (physics object)
Exit - Clears player[‘Car’] and Car[‘Rider’]
Turns Player[‘On’]True and Car[‘On’]=False
Moves player to Car’Seat2’
Sets camera target to car
Sets Car[‘Seat’] gameObject
Sets Car[‘Seat2’] gameObject (exit)
slows cars motions
HoverCarFinal (Cam) (1).blend (1.11 MB)
With the hovering vehicle i use i have it so you can only get out when you land.The hover vehicle is a car too but hovers.I use logic bricks to do mine.
The point of the script is to demonstrate a system of getting in, and out of vehicles,
I can go more in depth with it when we get to that point in wrectified,
I made this to provide a demo, as well as work out a good way to do it
Next time rather then setVisiblitiy(0)
I will use
player.worldOrientation = seat.worldOrientation
so the player gets snapped into the seat,
and then you can do
player.worldOrientation = Exit.worldOrientation
Now hover car, with “stand-in”
HoverCArEnterandExit.blend (770 KB)
I use orbitalninja’s model in resources.
Update- messed with model, changed turning dynamics
added much larger ground
You know what i hate about some games you are able to drive off the edge of the world.That is why for my game i am adding ground in the direction i travel.It is good for car driving games.It would be better if you can see from inside of the car the steering wheel and dashboard.When you get into the car.And the dash board should look realistic.But i did not make my dashboard realistic enough.You only have a steering wheel and a dashboard that you can see.
And finally. not faking the player, moving him to location of seat and exit,
HoverCarFinal.blend (836 KB)
Low, last mod, now the camera tracks the car different then the player
everything appears bug free, and logic light,
let me know if you see anything that could use fixing.
UPDATED TOP OF PAGE
HoverCarFinal (Cam).blend (1.11 MB)
Love the lights for the hovercar. How you made them?
They are spot lights in front of faces with a texture set emission to 1.0
I suppose I could swap out the car model and have thr lights off if the car is off, and turn on if the car is on. And add the lights. Remove them etc.
Good idea,a better idea would be to have it so that you can turn on the headlights with a keyboard key.