- Home /
Question by
Needlebeard · Dec 09, 2016 at 06:17 AM ·
unity 5raycasthit.point
Shifting a spawned bullet hole
I have made a program to create a bullet hole for where the gun hits, but I want it to be off center, but the point isn't clear as to how to shift everything. The code for spawning everything is as followed:
GameObject Googly_Eyes = Instantiate (GooglyEyes, hit.point, Quaternion.FromToRotation (Vector3.up, hit.normal)) as GameObject;
GooglyEye eyeScript = Googly_Eyes.GetComponent<GooglyEye> ();
eyeScript.hit = hit;
Googly_Eyes.transform.parent = hit.transform;
If you can explain where to modify to have the object generated about 5 units to the left I would be very grateful.
Comment
Googly_Eyes.transform.position += -transform.right * 5
Your answer
Follow this Question
Related Questions
Raycast not detecting ANY HITS AT ALL when starting inside a collider. 0 Answers
My Raycast on awake fires and will not change Help! 0 Answers
,How to lock the raycast on the first point hit? 2 Answers
Orientate a quad to the ray cast hit.normal 1 Answer
IsPointOverGameObject() not working as intended!!! 2 Answers