- Home /
Question by
MitchWardle · May 12, 2013 at 04:13 AM ·
bulletgun
Bullet Hole not inline with sight?(Center of Screen)
Whenever i shoot my bullet prefab/bullet hole is not in the center of my screen or the center of my Sign when i aim down sight the bullet prefab shows up quite abit under.
//My Shoot Prefab Script
var maxDist : float = 1000000000;
var decalHitWall : GameObject;
var floatInFrontOfWall : float = 0.00001;
function Update ()
{
var hit : RaycastHit;
if (Physics.Raycast(transform.position, transform.forward, hit, maxDist))
{
if (decalHitWall && hit.transform.tag == "Level Parts")
Instantiate(decalHitWall, hit.point + (hit.normal * floatInFrontOfWall), Quaternion.LookRotation(hit.normal));
}
Destroy(gameObject);
}
Comment
Answer by robertbu · May 12, 2013 at 04:15 AM
You need to add, not multiple floatInFrontOfWall:
(hit.normal + floatInFrontOfWall)
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
bullets wont show up 1 Answer
hide child object script - help 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
button question 1 Answer