I'm making a first person movement shooter and I'm trying to implement an ability where you fly for a brief moment in the direction you're looking, but I can't figure out how to get the direction you're looking at and apply a force in that direction. This is the code I'm using for the camera:
func _input(event):
#get mouse input for camera rotation
if event is InputEventMouseMotion:
rotate_y(deg2rad(-event.relative.x * mouse_sense))
head.rotate_x(deg2rad(-event.relative.y * mouse_sense))
head.rotation.x = clamp(head.rotation.x, deg2rad(-89), deg2rad(89))
head.rotation.y = clamp(head.rotation.y, deg2rad(0), deg2rad(0))
If anyone has any ideas I'd appreciate it. I haven't been able to find anything via google searches yet.