Interactible Marker
Last updated
Last updated
Working File:
Change the color of the static sprite to have 0 Alpha. Remove the Rigidbody2D and click on "Is Trigger." Edit the collider so that it accurately tells the range.
Now, just drag that UI sprite for the marker to the location you want it in the scene.
Then, make that marker sprite a child of the Interactible object.
This is going to be very simple. We will simply enable the marker when the player enters the trigger zone. You want to attach this below script to the Interactible gameObject in the scene.
Then, from the inspector, pull the marker sprite into the script component.
Depending on the style, you may want the marker to move. With the marker sprite selected in the scene hierarchy, create a new animation. Go to the time you want the thing to change, and add transform property. Create a new keyframe with the changed values. If needed, use the dopesheet to make sure it is undulating correctly.
Now, we can simply drag this as a child of the gameObjects and have it do all the same stuff all over again.
To make a prefab, pull that newly created gameObject in the scene view and pull it into the projects window of the folder of your choosing. I created a "Prefabs" folder.