- Home /
Shooting Accuracy Problem
Hello everyone i got problem in My Bullet Script
its Shooting About the CrossHair
CrossHair Script :
GUI.DrawTexture(new Rect(Input.mousePosition.x - (cursor.width / 2), (Screen.height - Input.mousePosition.y) - (cursor.height / 2), cursor.width, cursor.height), cursor);
And Here is Shooting
Instantiate(CurrentWeapon.Bullet, CurrentWeapon.SpawnPoint.position, CurrentWeapon.SpawnPoint.rotation)
//and For Moving Bullet [Script inside the bullet prefab]
transform.position = transform.position + Speed * -transform.right;
I've posted some code similar to yours in my answer below, take it, test it. Notice I'm not hiding the mouse cursor? This is so you can see that the crosshair center is exactly at the tip of the mouse cursor. This is what you want.
in my script the $$anonymous$$ouse Cursor is already in the center of Crosshair
the problem in the bullet direction
Ok so do you actually have to have a bullet? Or could you stand using raycast to shoot things w/ 100% accuracy? Not sure what you're going for.
i have Shooting.CS Script its Instantiate the Bullet
and i have Bullet.CS Script attached to the bullet prefab
it moveing the bullet :
transform.position = transform.position + Speed * -transform.right;
and not going to use raycast and i dont want to
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Bullets sometimes shoot under map 1 Answer
Random Raycast inside crosshairs 1 Answer
Shooting style like enter the dungeon 0 Answers