Download

Movin in first person inside a vehicle

Hi guys,

we are making an open universe space game. We want that our player can both drive a spaceship and walk inside of it.

So i have 2 pawns: one that receives the input of vehicle movements:

Immagine2.png

And another pawn inside the ship

Immagine2.png

From the level blueprint I settled that while pressing a button Switch the ship max velocity is set to 0 and the pawn is switched.

The first issue is that the second pawn is inside the collider of the ship, so after the switching everything start shaking compulsevily until the pawn is ejected out from the ship (!!).
if i disable the ship collider, the pawn starts falling (or with gravity disabled, it starts floating throught walls, chairs etc.

Another problem is that if I press the Switch Button, my ship continue to move and rotate. (When i Press Switch isDriving is set to False but the ship continue to move).

if (myPC->isDriving) {
	// Move plan forwards (with sweep so we stop when we collide with things)
	AddActorLocalOffset(LocalMove, true);


	// Rotate plane
	AddActorLocalRotation(DeltaRotation);
}

Anyone can help?

Thank you in advice,

Greetings,

Pasquale