Snapping only happens when I go to scene in play mode.
And not in Edit mode.
Did you try to move the block? If you don’t change anything in the scene, the [ExecuteInEditMode] function might not trigger Update.
If [ExecuteInEditMode] does not work, test [ExecuteAlways].
I tried that but it is not working .
Is the EditorSnap script attached to the Inspector of a Waypoint/Cube?
Add a Debug.Log to the Update method to see if its message appears in your console.
The message only appears in play mode…
EDIT:- I think I figured it out… I wrote the attribute above the class and it worked. Can you tell me why it did not work when the attribute was inside the class
Dear me! Good catch. I didn’t even notice that the tag was inside the class. That’s why I usually prefer code formatted as text. Screenshots are hard to read.
The attribute is a class attribute. For this reason, the class must be tagged with it, not some method inside the class.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.