- Home /
Question by
hari ram · Jan 30, 2014 at 02:49 PM ·
firingthird-person-shooter
third person shooter
I have a third person shooter on my game. He moves properly,But he fires randomly.How to set him fire only on the center of the screen??
please let me know where should I insert or modify the code.I'm using java script.
Comment
Answer by supermap · Jan 30, 2014 at 03:15 PM
Problem with TPS is that your center of the screen means aiming at a differebt spot for your charqcter depending on depth.
You could use a raycast to get the point where you are aiming and then make the charqcter aim at the spot
Sorry for the vague answer but that is all I can think of from the question.
Your answer
![](https://koobas.hobune.stream/wayback/20220613132113im_/https://answers.unity.com/themes/thub/images/avi.jpg)