Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ZUHAYR RUSHD |
I want the duplicate nodes to spawn, but the duplicates are not appearing in front of the camera. I attached a script to my camera which makes the camera go follow the duplicate but the duplicate nodes are not spawning levels as the duplicate nodes are appearing.
extends Spatial
var rand = RandomNumberGenerator.new()
onready var Levi = $i/RootNode/Plane002
onready var Levii = $ii/RootNode
onready var Leviii = $iii/RootNode/Plane
onready var Leviv = $iv/RootNode/Plane003
var last_pos = 0
var new_lev = Levi
func _ready():
pass
func _process(delta):
var val = rand.randi_range(1,4)
if val == 1:
Levi.duplicate().translation = Vector3(last_pos + 2,0,0)
elif val == 2:
Levii.duplicate().translation = Vector3(last_pos + 2,0,0)
elif val == 3:
Leviii.duplicate().translation = Vector3(last_pos + 2,0,0)
elif val == 4:
Leviv.duplicate().translation = Vector3(last_pos + 2,0,0)
last_pos += 2