Hello,
I'm making a kind of gun-shooting game with spine characters.
I'm considering to make bullet's trail with Unity raycast but it seems not react with spine bounding boxes.
Any advices?
Hello,
I'm making a kind of gun-shooting game with spine characters.
I'm considering to make bullet's trail with Unity raycast but it seems not react with spine bounding boxes.
Any advices?
Unfortunately general Unity Physics rules apply here, since BoundingBoxFollower
creates and updates a PolygonCollider2D
collider, it will only interact with the 2D physics subsystem. Creating a 3D MeshCollider instead (an extruded polygon) is also not trivial, since it needs triangulation of the outline's vertices to work.
Easier solutions would be to either:
Physics2D
queries to determine if e.g. a circle lies within the 2D collider.I found an article and it solved my issue.
The magic keyword is "Physics2D.GetRayIntersection" and it make 3d raycast possible to interact with spine bounding box.
Oh, thanks very much for sharing, great find! I didn't know that this method was really casting a 3D ray through the cap-area of 2D colliders!
Check how it works!
Very nice! Now add a hit animation! 8)