@ultrafop For general info on what updates when in the spine-unity runtime, see:
https://esotericsoftware.com/spine-unity-main-components#Script-Execution-Order
ultrafop If I have it toggled off and then set it to toggle on (think Megaman starting a stage), the projectile seems to come out at the last known position of the arm I'm aiming, even though the animation is updating.
I'm not sure how you determine the spawning position. If you use the BoneFollower
component, that might not have been updated this frame between setting and applying the animation and spawning the projectile.
BoneFollower
updates the position in LateUpdate
, so you might want to make sure your component which determines the location executes after the BoneFollower
component, or call boneFollower.LateUpdate()
manually before querying the position.
Another potential source of error might be from where (from which update method) you are enabling the GameObject. This might be out of order regarding the other components as well.
ultrafop I moved my projectile script (what fires objects from my pool) from the parent into the child/animation object, after my animation script, but the problem persists.
Note that it makes no difference in regards to script execution order if you move a component from a parent to a child GameObject. Also it makes no difference whether your component is shown above or below other components at the same GameObject. See the Unity documentation:
You cannot specify the order in which an event function is called for different instances of the same MonoBehaviour subclass. For example, the Update function of one MonoBehaviour might be called before or after the Update function for the same MonoBehaviour on another GameObject — including its own parent or child GameObjects.