hello there
I have a sprite of a monster with an axe, and i want to make an empty object that follows only the axe
any ideas?
Do you have to create the empty object with a script?
NO:
Make the object a child of the Axe and it will automaticly follow the parent
Yes:
then do your instantiate of the emptyobject and just add to your instansiate
Instantiate ().transform.parent = GameObject.Find(“Axe name”).transform
If the axe is part of the same sprite as the rest of the monster, then you need to manually determine the axe’s relative position to the rest of the monster gameobject in each frame of your animation yourself, by deciding what the position ought to be for each frame and setting the position in every frame based on which frame it is.
There’s no easy way around this, except by either 1) making the axe a separate sprite, or 2) deciding that your positioning doesn’t really need to be that accurate.
Side note: Don’t use GameObject.Find if you can avoid it.