Categories
WIP

Animation Control Script & Scene Control

  • Player Detection and Tracking
  1. The monster detects the player within a detect range and starts moving toward the player when the player is within range.
  2. If the player moves beyond the detection range, the monster returns to its starting position and stays idle.
  3. When the monster reaches the starting position, it should stop and rotate back to its original facing direction.
  • Attack Mechanism
  1. The monster attacks when it gets within the attack range of the player. The attack is triggered by setting the animator parameter.
  2. Once in attack range, the monster stops moving
  3. While attacking, the monster doesn’t move towards the player, but it plays an attack animation.
  • Animator State Transitions

The script uses animator parameters to transition between different animation states based on the monster’s behavior.

  • Collision&Trigger Detection

When the monsters’ hand touches the player, the alpha of a transition object’s material gradually increases from 0 to 1 This effect is achieved using a coroutine that smoothly adjusts the material’s transparency over a set duration. Once the alpha reaches 1, the game transitions to livel GameOver.

Leave a Reply

Your email address will not be published. Required fields are marked *