EDIT1: Oops sorry, wrong section, could a modo move that into the right one? Many thanks and sorry again
EDIT2: Oops again See post #4
I guess this have been explained numerous times, but...
I tried several methods, have read numerous tuts, and the only one which is working is the one below (found it on youtube), and yes, I did read the docs, but the given examples do not work either :
extends RigidBody
export var player_speed = 10
func _ready():
set_fixed_process(true)
func _fixed_process(delta):
var movement = Vector3(0,0,0)
var dir = get_global_transform() .basis
if Input.is_action_pressed("ui_left"):
rotate_y(-.0025)
elif Input.is_action_pressed("ui_right"):
rotate_y(.0025)
if Input.is_action_pressed("ui_up"):
movement -= dir[2]
elif Input.is_action_pressed("ui_down"):
movement += dir[2]
movement = movement.normalized() * player_speed
set_linear_velocity(Vector3(movement.x,get_linear_velocity().y,movement.z))
pass
Now here's where I'm stucked:
1) I don't want a rotation here (rotate_y(...)) but a lateral move on the X axis. Once again, I tried several things, no valid results.
2) I would want to assign other keys to the said movements. But where do I have to put them and how?
3) I would want to asign the keys up and down (dedicated to forward and backward moves here) to up and down moves along the y axis. I guess it would be the same method that for 1). Here too, I tried several things...nothing.
4) I would want that the object follow the cursor movements, how do I implement that?
5) export var player_speed = 10
I tried to change the value but no effect (I tried 1500... no changes)
I know I ask a lot but I'm a bit desperate. I really would want to learn without diving into the entire library dedicated to Python, so is there someone enough kind to give explanations for dummies?
Thanks by advance