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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.