Ok, now I understand the problem...
Yes, you are right - assuming you had equal movement in all directions (your example does not) - for example right = (1,0) and down = (0,1) - selecting both together means you move (1,1) on a diagonal which has length = 1.41. So, the player moves further when 2 keys pressed. Normalize will stop that by setting the length of the diagonal vector to 1, so that makes your right (0.71,0) and down (0,0.71).
In your case, you want a movement of 15 for forward, or 8 for other directions but normalize will set the speed in all directions to 1 (or 0.71 if moving diagonally), so this will cancel the effect of your movementspeed*
You could move the speed calculation after the normalize.
To account for the faster speed when moving forward, you would need to increase that move when you scale
Maybe something like this (I have not tested this in 3d, so it might have errors)
var movement = Vector3()
var movement_speed = 8
var forward = false
var mouse_sen = 0.3
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _physics_process(delta):
if Input.is_action_pressed("ui_cancel"):
get_tree().quit()
var direction = Vector3()
if Input.is_action_pressed("ui_up"):
direction += -transform.basis.z
forward = true # temporary flag to track that movement includes a forward element
else:
forward = false
if Input.is_action_pressed("ui_down"):
direction += transform.basis.z
if Input.is_action_pressed("ui_left"):
direction += -transform.basis.x
if Input.is_action_pressed("ui_right"):
direction += transform.basis.x
direction = direction.normalized() # this will always be length of 1 but you need it longer when moving forward
if forward:
direction += -transform.basis.z # Double speed if moving forward, after normalizing
movement = direction * movement_speed
movement = move_and_slide(movement,Vector3.UP)