As mentioned in the post below I make such puzzles, Like Poppy Playtime Puzzle.
4 Answers
4Hello mate,
Your post is very confusing, what do you want to achieve? are you trying to make a key/door system? or do you want to learn how to make a copy of Poppy Playtime? could you elaborate and list what you are trying to do please
Simple Meaning I want to make it so that when pick up the player object
Drop it to its actual location and open a new door.
Poppy Playtime can be taken as an example.
In Unity 3D
Hello mate,
It’s pretty simple, you can use a boolean on a script attached to the player:
public bool hasKey;
And when the player collides with the key you change the boolean to true:
private void OnCollisionEnter(Collision other) {
if (other.CompareTag("Key") == true) { // the key has the tag Key (case sensitive)
this.hasKey = true;
other.gameObject.SetActive(false);
}
}
And finally when triggering the door you check the boolean:
private void OnTriggerEnter(Collider other) {
if (other.CompareTag("Door") == true) {
if (this.hasKey == true) {
this.hasKey = false;
other.gameObject.SetActive(false);
}
}
}
Hello again @unity_C021CCFB576C9421E9FD,
Here is a video:
I used one of my games because I didn’t want to make the player movement

thank you but, where attach Script? Means the door and key script are different.
– unity_C021CCFB576C9421E9FDNo I made it so you can put all of these in the script attached to the player, you just need to add a trigger around the door and a collider on the key
– Cyber_CatsCan you explain by video ?
– unity_C021CCFB576C9421E9FDSure but there is really not much to it, you make a gameObject for the player, the key and the door, you attach a script to your player for movement and key system and you attach colliders and rigidbodies where you need
– Cyber_Cats