Sign in to follow this  
psikoT

Character Controller

Recommended Posts

Hi, sorry if this question has been answered before, but couldn't find a proper solution for a Character Controller... I've tried some character setups from this forum but they don't work with my models.

Is there any simple example that I can take as starting point?

Thanks in advance.

Share this post


Link to post
Share on other sites

Hi, thanks for reply... yes, I've tried hard to implement that solution, but it didn't worked with my character. For some reason, the character start rotating crazy in the Z axis. 

I'm exporting from 3dsMax, with the default orientation from the biped. It runs fine after exporting though. I'm wondering if there's any way to compare my models with the model from that example.

Share this post


Link to post
Share on other sites

Hi @psikoT

Thanks for providing the character.

Found what the issue is.

Your model has Z up and Y forward.

Babylon (and the Character Controller) expects Y up and Z forward.

Here is a screenshot of your character in babylon sandbox.

If you can change that then it will work fine.

Nice character and animations by the way :)

 

sandbox.jpg

Share this post


Link to post
Share on other sites

@psikoT 

Found a way by which you can make your model work without changing its orientation.

Create an empty mesh, make it a parent of your model and pass that, instead of your model, to the character controller.

Use character controller setAvatarSkeleton() method to set the skeleton to your model's skeleton

Attached  is an updated version of your index.html which works.

 

index.html

Share this post


Link to post
Share on other sites

@satguru

I was totally sure that it was Y-up, as I'm used to the FBX exporter from 3dsMax, which has an option to change the vertical axis. Unfortunately, the Babylon exporter has no such option, but I think I have a workaround inside 3dsMax. If it doesn't work, then I'll try to make the parent mesh in Babylon as you suggested. For some reason the controls don't work in your example, but I'm probably missing something. Still very new on this.

Thanks very much for the input, I really appreciate. And glad you like the model. The animations are from Mixamo, in case it helps.

Cheers

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.