VehicleBody3D
Asked Answered
M

2

0

Hello, I'm working with VehicleBody3D and trying to let the user jump. I've been been able to implement jumps in 2d and 3d character bodies without much issue by following some tutorials, but I am failing to find anything for making a vehicle jump.

Any adivce?

Thanks.

Matron answered 4/12, 2023 at 17:44 Comment(0)
G
0

VehicleBody3D inherits from RigidBody3D rather than CharacterBody3D, so you have to use velocity or force to make it jump.

Rudimentary example using force:

func _physics_process(delta):
	if (Input.is_action_just_pressed(&"jump")):
		apply_central_impulse(Vector3.UP * 300.0)
Gerdi answered 4/12, 2023 at 18:36 Comment(0)
M
0

Gerdi thank you very much

Matron answered 4/12, 2023 at 19:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.