Padlock Sys - Setup
Padlock System - Setup Video
Padlock Controller Main Setup
How to add a trigger event to for this system?
Basic Steps
Padlock Objects Setup
Main Camera Setup Example
The Main Camera has an Empty GameObject called "Padlocks"
Then 4 different padlocks each with separate features
LockMechanism - Is the Latch with the animation when the lock opens
PadlockCombination - The Spinners with the "SpinnerScript" attached

Padlock World Objects Example
Padlock_Interactable_A2: This is a PBR 3D Padlock
Padlock_Controller_A2: Empty GameObject with the Padlock Controller script
Door_A1: The door object you want to open
FrameComponent: Some additional 3D assets (NOT REQUIRED)

Padlock Controller Setup

Combination and Camera Padlock References:
Your Combination
The 4 number combination to unlock the padlock
Camera Padlock
Add the "Padlock_Camera_Mechanism_A1" from the padlock attached to the camera
Lock Anim
Add the "LockMechanism_A1" from the "Padlock_Mechanism" attached to the camera
World Objects:
Interactable Lock
Add the "Padlock_Interactable_A2" or similar 3D object which is the world object
Trigger Type - ONLY If using a trigger event:
Trigger Event
Add the "Padlock Trigger" which will be a gameobject you create
IsPadlockTrigger
Tick if you're using a Padlock Trigger
Unlock Events:
public class PadlockDoorAnimation : MonoBehaviour
{
private Animator anim;
private void Start()
{
anim = GetComponent<Animator>();
}
public void PlayAnimation()
{
//This is an example of playing the "DoorOpen" animation
anim.Play("DoorOpen", 0, 0.0f);
}
}
Padlock Interactable Item Controller

Padlock Spinner / Combination Setup

Default Controls
Last updated
Was this helpful?