The reason I am asking this is that I have a Player, a Bow and an arrow.
the bow follows the arrow and is placed a distance away from the player in the direction of the mouse and rotated to face the mouse.
the arrow is spawned by the bow and is held in place at the bow’s location and rotation.
The issue is that when the player moves, this causes the bow to move to the last frame’s location of player, the same happens for the arrow… so its like I have rubber banded the three objects together as opposed to gluing them together.
can I update the player location, then bow then arrow in the same frame so they are all in the same location when the frame goes to render?
or am I simply going about this all wrong?
For the record, I’d just like to add here that, yes, the “script execution order” settings also affect FixedUpdate() order, not just Update().
I was looking for the answer to that and saw conflicting answers, and Unity’s docs don’t explicitly say one way or the other, so I just tested it (in 2019.1) and it works as one would hope.
If Script Execution Order in the Edit panel does not solve the issue, then the solution is rather simple: update the positions in LateUpdate. Or you just set up the execution order the wrong way. Try both. Would be great to see your execution order tab.
I like the answers/suggestions given but in this case I wanted to keep the bow separate. reordering the execution sequence did not work.
I fixed this solution and will state what I did so that others may find this useful.
I ended up rewriting the movement code for the bow and arrow along with the shooting.
what I ended up with is that when the player is moved, in the player’s fixed update where we move the player, we also call Bow.Move(Vector3 position, Quaternion rotation). this function updates the bow’s location and rotation but also calls Arrow.Move(Vector3 position, Quaternion rotation) if the arrow had not been fired.
now, all movement that the bow and arrow do, is actually executed during the fixed update for the player.