- Home /
Duplicate hit effect on to another object
Hi There,
What I'm trying to achieve is that when I hit a specific object I want the hit affect duplicated exactly where it hit on the original object.
So cube 2 has a bullet hole, every time I click on cube 2 it instantiates a bullet hole effect based on the raycast hit.point on the collider.
Is there a way I can replicate the bullet position hole on cube 2 to cube 1 once it's clicked so it's like a copy.
Thanks,
Answer by sacredgeometry · Dec 21, 2020 at 06:10 PM
If the cubes are identical (and even if they are not):
You are I assume using the texture coord positions to update the texture with the bullet hole right? That UV position would/ can be exactly the same on both objects.
I'm using the method where I use the hit.point of the raycast and insatiate a new game object (i.e the bullet hole) onto the the hit.point
Oh ok in that case then just instantiate it in that objects normalised local space instead of world space and the local space will be transferable between objects
Your answer
Follow this Question
Related Questions
C# Instantiating a Gameobject with a Flat Sphere Collider 1 Answer
OnTriggerEnter() not working 1 Answer
After I instantiate multiple objects, can i group them all and add a larger collider? 0 Answers
Moving a object randomly without it being inside a wall 1 Answer
How can I add the OnTriggerEnter function to all game objects that I instantiate? 1 Answer