Godot Version
4.2
Question
I am trying to make a mirror reflect the laser that it collides with. I have managed to instantiate a new laser scene when it collides with a mirror but I can’t change the transform of this new instantiated scene. I straight up can’t access the transform property. The laser i have is a separate scene and the instantiating script is also attached to the parent node of this laser scene. I am using PackedScene. If what I am doing is wrong then what should I be doing instead.
if(collided_object is Node node)
{
if(node.IsInGroup(“Mirrors”) && laserReflected == false)
{
laserReflected = true;
var scene = GD.Load(“res://Laser.tscn”);
Node instance = scene.Instantiate();
AddChild(instance);
}
}
This is the code. If you need more information please let me know.
Thank you all in advance!