Could someone please tell me how to solve my problem.
What I want to do is create a spear and enemies hit by it become impaled on it. What I can’t get my head around is I want to place each new enemy further up the spear. Image below.
Could someone please tell me how to solve my problem.
What I want to do is create a spear and enemies hit by it become impaled on it. What I can’t get my head around is I want to place each new enemy further up the spear. Image below.
Heyyo!
Sorry if I misunderstood, but I cannot seem to relate your post’s title to your description. So I’ll try to answer your title, which I have a better understanding of!
To find the center of a box collider in object space, you’ll need to use:
// Assuming that you have a BoxCollider variable named "boxCollider"
Vector3 boxColliderCenter = boxCollider.center
To find the center of a box collider in world space, you’ll need to use:
// Assuming that you have a BoxCollider variable named "boxCollider"
Vector3 boxColliderCenter = transform.TransformPoint(boxCollider.center)
Hope this helps!
Let me know if you have any other questions related to moving the position enemies after they are hit by the collider or something else c: