[ad_1]
The raycast is executed as quickly as you name the operate. In truth, you’re usually going to need to use the results of the raycast inside the identical replace, and that simply would not be potential if the execution was delayed.
Now, I’m not an knowledgeable on how the physics engine works underneath the hood, however my understanding is you can work together with physics objects at any level, not simply MountedUpdate
. The factor is that the adjustments that you simply make (including a power to a rigidbody, for instance) are usually not going to have an effect on something till the pyhisics engine runs its personal inner replace (which occurs proper after MountedUpdate
). So, for those who add a power in Update
, and in the course of the subsequent body (assuming the MountedUpdate
has not happenend but) you verify the rate of the thing, you will note that it has not modified in any respect. But as soon as the physics engine updates, it can work the identical method as for those who had added the power in MountedUpdate
.
TL;DR is there’s nothing magic about MountedUpdate
, it merely is a option to execute your code proper earlier than the interior physics loop replace.
[ad_2]