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

Introduction to Flaky Tests by Example

[Solved] How to install Cocoapods on M1 Mac - when “sudo gem install ffi” FAIL

How to Detect JSON Insecure Deserialization Threats in Python

PROGRAMMING LANGUAGE FOR KIDS

tiptop customer care number/8584892730//8584892738/tiptop customer care…

ConfluxPortal Installation and User Manual

Hacking Docker: Discovering Containers

Dynamic Programming Patterns, become good to great & How to approach most of DP problems.

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

Conditional CSS Class with Surface-UI

Using the Animation Override Track in Timeline

How To Use Post Processing In Unity

A Simple Shop System for a Unity 2D Game — Part 2: UI Mechanics