Prefab the Whole Platform- Game Dev Series 91

Objective: bundle the whole platform with ledge checker system into a prefab.

If we want to keep using the ledge grabbing system in game, create a prefab would be necessary. However, to copy the system without any bug require some adjustment.

In this article, we will create a perfect functional ledge grabbing system prefab.

Replace the Vector3 data

The most important thing to prevent bug is fix the static Vector3 data. So far we use a specific Vector3 value as snapping position and standing position.
To fix this issue, we can create 2 empty gameobject to storage the position.

Next we need to check the Vector3 value to these gameobject. Keep the value of Hand Position and Stand Position.

Play the game and duplicate Player. Make the duplicated Player into Hanging animation state, Then use the value of Hand Position to make it snap to the place.
Drag duplicated Player into Ledge_Checker as child object, and copy the local position value of that Player object.

Disable the Play mode, and paste the value to Hand Position gameobject. Now it should have the position where Player should snapped into.

And do the same setting to Stand Position.

Now we got the local position of Hand Position and Stand Position, we can adjust the Ledge script.

Use the new Vector3

Inside script, all we have to do is to create 2 variables of the gameobjects. And drag it in editor.

Then replace the origin Vector3 reference to these 2.

That should be done! Now we can prefab the whole platform and create some level with it.




A passionate gamer whose goal is to work in video game development.

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

Recommended from Medium

VS Code: Auto-completion Intellisense Troubleshooting Guide

Tellor reporter call February 9th 2022 Links Youtube link:

How to use data version control (dvc) in a machine learning project

Important Announcement: Servers, PC/Mobile Wallets

Go to work with MongoDB. What is it and How does it work?

Why should you start to be interested in Test Driven Development ?


Storing Data With Room

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
S.J. Jason Liu

S.J. Jason Liu

A passionate gamer whose goal is to work in video game development.

More from Medium

Day 103: Creating A Ledge Grab in Unity Part 1

Adding a burst laser powerup

Using GameDevHQ’s FileBase Asset Database For HQ Models

Creating Elevator in Unity — Part 3: Moving Elevator.