Day 90 — Creating a Ledge Grab Mechanic

public void GrabLedge(Vector3 handPos)
{
_controller.enabled = false;
_anim.SetBool("LedgeGrab", true);
transform.position = handPos;
}
[SerializeField]
private Vector3 _handPos;
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Ledge_Grabber")
{
Player playerController = other.transform.parent.GetComponent<Player>();
if (playerController != null)
{
playerController.GrabLedge(_handPos);
}
else
{
Debug.LogError("Can't find Player script");
}
}
}

--

--

--

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.

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

Recommended from Medium

Hangman Game in Python

How to install conda on Google Colab

buildg: Interactive Debugger for Dockerfile

Types of Dimension Tables in a Data Warehouse

How to get comments from a Word DOCX document hierarchically in Python

Setup an EC2 instance with ubuntu 20.04 server

Demystifying Recursion

Installing rtweet on Raspberry PI Zero W

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
Connor Fullarton

Connor Fullarton

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.

More from Medium

Learn to code by Making 2.5 D Space Shooter Game.

What are “Render Pipelines” in Unity?

How to Make the Camera Shake Using Impulse Listener Extensions in Cinemachines Virtual Cameras

Creating A Modular Powerup System in Unity