diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8d9fba2f9f01c30ffe7850145ecac9deb2a6bf35 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# Interactable + +These two scripts allow for Interaction between Players and GameObjects (e.g. by pressing <kbd>E</kbd>. + + + +In this video you can see the cube changes its Material to a green one, once it is looked at, and when E is pressed a function is executed which moves it to the right. + + + +## Installation + +Import `Interacting.cs` and `Interactable.cs` as Assets into your scene by doing one of the following things: +- clone this repository into your assets folder +- download the repository as a zip folder, unpack it and drag the files into the Assets Window +- click the files and copy the text into a C# script of your choice (just make sure the class name matches the file name!) + +## Usage + +1. Drag the `Interacting.cs` onto the `Player` Object that also has the Camera on them +2. Setup the Keyboard Key you want to use for Interaction +3. Drag the `Interactable.cs` onto any number of GameObjects you want to allow Interactions with +4. Set up a Material and a Override Material and Add an Event (Object + Method) which will be executed whenever the object is beeing interacted with + + diff --git a/images/interactable.png b/images/interactable.png new file mode 100644 index 0000000000000000000000000000000000000000..961c6634b7a996e9d70f16c4c773da9a588df940 Binary files /dev/null and b/images/interactable.png differ diff --git a/images/video.apng b/images/video.apng new file mode 100644 index 0000000000000000000000000000000000000000..5aa019b56e7cdca005bec52cf904d39a9ec9aa09 Binary files /dev/null and b/images/video.apng differ