Simple "E" to interact script...

I do know quite a bit with OnTriggerEnter and OnTriggerExit. But however, how would I script and event that takes place (animation + sound) when the player presses the “E” key? I have an FPS controller, and so will I need to reset the cursor position to the center of the screen in my update method, as so to select properly?

I remain doubtful until I receive guidance…

Thanks in advance!

I don’t know as part of the resetting the cursor but to make the E key animation and sound you could use:

var yourSound : AudioClip;

if (Input.GetKey("e"))
{
     animation.Play(yourAnimation);
     audio.PlayOneShot(yourSound);
}

Hope this gives you some guidance :slight_smile: