Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How Can I Detect Collision For Part of a Sprite?

$
0
0
I'm looking to create a 2D game (using the new 2D tools) where characters can swing swords and I want to be able to detect if something collided with just the sword, and not the rest of the sprite. I have not made the character assets yet. The simplest method seems to be making the sword a separate sprite, but I would like to make the character and sword in the same sprite. This seems like a similar problem for sprite-based 2D fighting games: when a character punches we would want to check collision with the fist, not the whole sprite, to determine if an attack has landed on the opponent. How can I do something similar? Disclaimer: I'm brand new to Unity and newish to game dev. Thank you!

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>