Jump to content
randomkeyhits

UpdatePhysics vs UpdateWorld

Recommended Posts

This is a query more than anything.

 

As I read the documentation both Script:UpdateWorld() and Script:UpdatePhysics() are both initiated by a single call to World::Update(). In fact the physics is a child of world and is always(?) invoked.

 

So it appears that the separation is more a conceptual one rather than a functional one.

 

The only reason I can think of is by putting all physics in UpdatePhysics then if (I'm not sure) that is invoked first you would know that all physics updates have been applied before you do any other world level checks/logic.

 

So is that it or am I missing something important?

 

I'm feeling rather dense today.

Share this post


Link to post

UpdateWorld() is called as fast as the PC runs where UpdatePhysics() is called at a constant rate (promises to run x times per second) from what I remember. Which I think would mean if you have a slow PC then UpdatePhysics() might be called multiple times per cycle to catch up.

Share this post


Link to post

Hi all,

so i can resume in:

UpdateWorldHook is called as fast as the PC

UpdatePhysicsHook is called at a constant rate ( promises to run x times per second )

 

 

In my case i see always UpdatePhysicsHook called two times

and UpdateWorldHook only one times per cycle...

 

 

At this point is better to put heavy operations in UpdateWorldHook,

and leave UpdatePhysicsHook calls all physics function calls with their respective variables?!?

Share this post


Link to post

Yeah, UpdatePhysics might be called more than once per cycle or not at all per cycle. My understanding is it tries to keep the constant 60fps rate no matter how it has to do that. UpdateWorld just runs once every cycle/loop.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...