Sign in to follow this  
Ridge Batty

How to keep animations running?

Recommended Posts

Looks like animations stop updating when they go outside the frustum...

this is quite annoying when trying to render stuff which is close to camera, like avatar's body in first person view. When your hands  go outside the view, they never come back :P

I tried attaching invisible meshes in animations but it has it's drawbacks and it feels like i'm fighting (a losing battle) against the system.

Any suggestions how to force the animations to keep running even when they go outside the view?

Share this post


Link to post
Share on other sites

If you are using a mesh before renderer, to do the animating then switch to a scene level before renderer.  The mesh one only runs when the mesh is going to be drawn,  Also, if there are multiple cameras, eg. webVR, then it is run twice per frame.  A scene render is run once per frame.

Share this post


Link to post
Share on other sites

I'm not sure if you mean this:

_this.scene.registerBeforeRender(function(){ 
                _this.playerControls();
                _this.playerAnimations();
});

but that's how i'm doing it. 

Share this post


Link to post
Share on other sites

That is a scene level beforeRender, and it should run every frame, just once.  FYI, the mesh version would be:  myMesh. registerBeforeRender (function()...

What is "_this", a mesh?  If so, other than a PG, you could add a line to function to write to console , if not visible.  "if (!_this.isVisible) console.log('still running')". 

Make it not visible at some point, and see if tons of messages get logged.  If they do, then there is a problem with your playerAnimations().

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.