Hi , So I am am trying to change my enemy mesh color when player enters in Enemy’s area
here is the code - `$EnemyMesh.getsurfacematerial(0).set_albedo(Color(1,0,0))’
I have a spatial material on this $EnemyMesh
Here is the tutorial which I am following - https://youtu.be/
In this video code properly worked and mesh changed its color but when I does the same thing I got this awkward type of error
Attempt to call function ‘set_albedo’ in base ‘null instance’ on a null instance.
Here is my node hierarchy of enemy scene -
Enemy
-EnemyMesh
-MeshInstance2
-CollisionShape
-Area
—CollisionPolygon
It is saying that $EnemyMesh
is null instance whereas it is in node hierarchy. I don’t know why it is not working for me but working in this tutorial which is given above.
Please anyone help me
It’s much appreciated