Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | jamjamjam |
Hi I’m new to godot and got some GDscripts running ok, but want to use c#.
(It’sworth it for me, as I’ve built big games in c#, and just don’t get on with python/lua derivatives)
I’m finding it very hard, particularly to get instantiating right, as it seems that instantiate throws you a node back, but Nodes seem not to have any access to a transform.
eg:
void _fire() {
if (prefab != null) {
Node vBullet = prefab.Instance() ;
GetTree().GetRoot().AddChild(bullet);
bullet.Translation =GlobalTransform.origin;
bullet.Rotation = (GlobalTransform.basis.GetEuler());
bullet.fwd = new Vector3(0, 0, -1);
}
}