Working with Animation Events in Unity

Creating an Animation event

  • In Player.cs, create a reference for LedgeChecker called activeLedge
  • In LedgeChecker.cs, create a Vector3 reference for the standPos in LedgeChecker.cs
  • In OnTriggerEnter, add a parameter this when calling GrabLedge()
  • Create a method of type Vector3 GetStandPos() to return standPos
  • Set the Player’s position to GetStandPos()
  • Place the player in the exact place where the climbUp animation finishes to get the standupPos value
  • As it will be a modular script, we need to set that value automatically. For this, you can create a reference for standPos in Player.cs and modify it in the inspector when you have found the correct position

Animation events

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

OS Installation in TamilNadu

OS Installation in TamilNadu

Background Job & Queue — Pushing Millions of Notifications per Hour

A complete list of articles on Unit Testing with Swift from 2017

How to Make Your OpenStack Environment Enterprise Ready

How to Convert Strings to Booleans in Ruby

Common Table Expression

Migrating Legacy Monolithic .NET Framework Applications to Windows Containers using Docker

Agile and Scrum Methodology: How We Use Them In PPL 2022

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Hernando Nieto Jaramillo

Hernando Nieto Jaramillo

Unity developer

More from Medium

Light layers in Unity HDRP

The Great Fleece Development Recap (Part 1)

Creating a UI Shield Strength indicator

Hidden Shortcuts to Make Level Design Easier in Unity.