Quick-Start

Importing and initial setup

First of all, import the asset into your project. The asset will create a folder 'Ameye' under your Assets directory. I strongly advise you to not mess around too much with this folder structure. As far as I know there are no parts of the asset that depend on this structure, but you never know.

Basic setup

Now that we're done setting up the asset, we can actually start creating some doors! We will first create a player in our scene. Make sure that the player can move around and look around in your scene. If you want to, you can use the player prefab that is included in the asset. Notice that the player has the door detection component attached to it. If you are using your own player controller, make sure to add this door detection component as well. In the inspector of the detection component, set the reach variable to a value of around 5.

Player Prefab

Now our player is done and we can start creating a door! Just create a basic door shape out of a default cube and place it in your scene. After you have a created a door that you're happy with, add the door rotation component to it. The hierarchy structure around your door will automatically be changed. Notice that some icons will appear in the hierarchy to visualize which object has the actual door script on it. Do not change this hierarchy structure.

The door rotation component

Take a look at the door rotation component. We will be adding a single rotation to it by pressing the 'plus' button on the Rotation Timeline. After we've added a rotation block, there will appear a blue zone in the scene and the hierarchy around your door will be changed again. Let's set the values of the rotation block to an initial angle of 0, a final angle of 90, a speed of 2 and a smoothstep curve.

The rotation timeline

Now that our rotation itself is set up, we will take a look at that blue zone that just spawned. This zone is a trigger zone and it will control our rotation. Select the 'Move Trigger' in the hierarchy 'and take a look at the inspector window. We will ask for our player to press "E" in order to rotate the door so toggle 'Pressed' and put the letter 'e' in the field that appears. If you'd like to, you can resize the trigger zone in your scene so it's a bit bigger.

The Move Trigger

We've set up everything required so let's hit play! As expected we can enter the blue trigger zone, and when we press 'E', the door will rotate 90 degrees with a speed of 2 (duration of 0.5 seconds).