- Home /
RigibBody and ignored Input.GetKeyDown
Hello !
I'm facing a very strange problem right now. I'm having two scripts running simultaneously, one is a simple dialog that I cooked myself and one is an interaction using physics.
What I'm trying to do is display a dialog and simultaneously launch a sphere with a rigidbody. Both actions works with the same key (Fire1). The two scripts are completely independant but both check if fire1 has been pressed down during the frame (in the update function), and if so, one script launch the ball and the other display the next sentence in my dialog.
The rigidbody is not on the sphere and is added at runtime in the script for the sphere. However, when I press fire1, only the sphere script gets it and not not the dialog one. After a lot of test, I realised that it was the rigidbody that was responsible : if I don't add it, both scripts get the input, but once I add the rigidbody to the ball, it's like the input gets eaten and not taken into account in the dialog script.
Am I missing something really simple ?
It looks like you are getting some error and the script playing is stopped before the Fire1 input gets to the other script.
Rigidbody should not be preventing input to a script on an object that is completely unrelated. Please file a bug report if you have a reproducible project.
$$anonymous$$ake sure you have the dialog script attached to something also. It doesn't make any sense why the rigidbody would cause that. $$anonymous$$ake sure to check that there is nothing else going on. Try making a new scene and testing just the dialog and sphere alone
$$anonymous$$y scene is indeed quite complicated and specific to my situation. I will try to reproduce the bug in a simple scene and, if needed, submit a bug report. I'll do that as soon as possible, I don't really have the time right now, I'm a student and a lot of work these days... Thanks for the help anyway !
Your answer
Follow this Question
Related Questions
Odd input glitch 2 Answers
3D world 2D gameplay, keep player in the camera? 1 Answer
Falling object touch 0 Answers