how to simulate a keystroke on a triggerEnter?
I have two rather lengthy and complex scripts in my FPS game that on pressing the F key, I put away my weapon, then pressing it again I draw my weapon. Sounds pretty simple but each script involves toggling several things on and off. I tried rewriting the script using OnTriggerEnter instead of on GetKeyDown but it doesn't work for some reason. o I was wondering if there is a way to simply say something like onTriggerEnter run the script . I found something called inputsimulator.codeplex. but it looks like something that needs to be installed on your computer rather than a script that runs in unity
Your answer
![](https://koobas.hobune.stream/wayback/20220612120835im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
(No code need, just show me the way) On trigger enter, press key (or hold) to play cutscene 0 Answers
How to make my Power Button stop my Conveyor Belt 0 Answers
I need help getting a sound to play when the E Key is pressed. (E will also load a new Scene). 2 Answers
Trigger when holding key 1 Answer