Enter and exit a vehicle ( Exit and entry spawn points)

Player Controls
R= enter car when touching car and doors are open.

Wsad = move player

Car_Controls
Wsad = throttle for car

Q (open doors) + E= Exit car when doors are open.

============Scripts====================

Enter
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
Exit - Clears player[‘Car’] and Car[‘Rider’]
Turns Player[‘On’]True and Car[‘On’]=False
Moves player to Car’Seat2’
unparents player

Gamelogic_simple
Sets camera target to car

Text
Sets Car[‘Seat’] gameObject

Text.001
Sets Car[‘Seat2’] gameObject (exit)

Dampen

slows cars motions

Attachments

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 :smiley:

Next time rather then setVisiblitiy(0)

I will use

player.worldPostion= seat.worldPostition
player.worldOrientation = seat.worldOrientation

so the player gets snapped into the seat,

and then you can do
player.worldPostion= Exit.worldPostition
player.worldOrientation = Exit.worldOrientation

Update -

Now hover car, with “stand-in”

Attachments

HoverCArEnterandExit.blend (770 KB)

I use orbitalninja’s model in resources.

Update- messed with model, changed turning dynamics

http://www.pasteall.org/blend/27508

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,

Attachments

HoverCarFinal.blend (836 KB)

Low, last mod, now the camera tracks the car different then the player :smiley:

everything appears bug free, and logic light,

let me know if you see anything that could use fixing.

UPDATED TOP OF PAGE

Attachments

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.

Yar,

it tis, and it be,