New Input System - Interact
Reference Link: https://learn.unity.com/tutorial/world-interactions-dialogue-raycast?uv=2020.3&projectId=5c6166dbedbc2a0021b1bc7c#
Fixing Stupidity
The raycast will hit itself if you don't set up the project files correctly.
Reference Link: https://stackoverflow.com/questions/38191659/unity-physics2d-raycast-hits-itself

Uncheck at least the "Queries Start in Colliders."
Testing
To make sure the raycast is not stupid, check it with:
It's because I tested the distance that I was figuring out why I kept getting a hit each time.
Look Direction
Reference Link: https://docs.unity3d.com/ScriptReference/Vector2-ctor.html
You want to set this where you set that lastMoveX in the animator.
Button Firing too many times in Input System
Reference Link: https://forum.unity.com/threads/player-input-component-triggering-events-multiple-times.851959/
For our project:
Script adapted from Ruby's Adventure
Disabling Movement for UI
To switch to UI, you can change the Action Map. You need to set the default action map in the previous section first before switching.
This Interact function will trigger the DiaManager's "Show" function (This is the UI controller for the dialogue box). That is when we want to stop the player from moving.
Last updated