![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | 0sait05 |
How do I return variable to the other if statement?
I want x
z
to be zero and y
to be five for all if statement if "reset_camera"
is pressed
var y = -5
var z = 0
var x = 0
export (NodePath) var camera_reset_cupdown
onready var building = get_node(camera_reset_cupdown)
func repeat_me():
if Input.is_action_pressed("reset_camera"):
building.set_translation(Vector3(0,0,-5))
if Input.is_action_pressed("reset_camera"):
Bitemnode.set_translation(Vector3( 0, 0 ,-5))
if Input.is_action_pressed("pos_up"):
y += 0.1
Bitemnode.set_translation(Vector3( x, z ,y))
if Input.is_action_pressed("pos_down"):
y-=0.1
Bitemnode.set_translation(Vector3( x, z ,y))
if Input.is_action_pressed("pos_left"):
x+=0.1
Bitemnode.set_translation(Vector3( x, z ,y))
if Input.is_action_pressed("pos_right"):
x-=0.1
Bitemnode.set_translation(Vector3( x, z ,y))
if Input.is_action_pressed("pos_high"):
z+=0.1
Bitemnode.set_translation(Vector3( x, z ,y))
if Input.is_action_pressed("pos_low"):
z-=0.1
Bitemnode.set_translation(Vector3( x, z ,y))