Global_transfrom on Node3D global_transform becomes invalid for no reason (Minimal reproducible example included)

Godot Version

4.3

Question

I was trying to port a script I wrote for Unity into GDscript. I had various problems which I was working through, but I have isolated an error which I really cannot understand. Basically, accessing the global_transform of a Node3D (which itself is definitely NOT null or not being referenced correctly) with nothing else on it goes from existing to giving the error

Invalid access to property or key ‘global_transfrom’ on a base object of type ‘Node3D’.

when accessed. To reproduce this:

  1. Create a new project and a 3D scene that looks like this
    drgfdrgfszgrdfrdgf
  2. Create a new script and add it onto one of the Node3Ds
extends Node3D

@export var follower : Node3D

func _process(delta: float) -> void:
	print(follower.global_transfrom.basis)
  1. Set the value “follower” to the other node in the inspector
    regrgedrg

  2. If now run, it produces the following error:

I cannot understand this at all. Furthermore, it only seems to give the error on the last line of _process, as below the first two go through without error and their outputs fine. The error only occurs on the 3rd line!

I really cannot understand why I am gettiing this error in any way at all. Can anyone explain why global_transform becomes inacessible even though there’s literally nothing else going on in this scene???

You have a typo there. It should be global_transform, not global_transfrom.

1 Like

oh god how embarassing

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.