Jump to content

Rotate character


rkstyle
 Share

Recommended Posts

Hiya rk, sorry for the slow replies.  Your post landed out on the "main area" and we didn't see it... so I moved it to Q&A... hope that's cool with you.

Here ya go.

http://playground.babylonjs.com/#41IFI5#10

That's a fancy one...  left click mesh to rotate 45 degrees ONE way, right click mesh for the other way.  Uses a little function called "spin"... at the top of the playground.

It has a nice easing.  You can set turn speeds in lines 27 and 32.

The GUI simpleButton came along for the ride... maybe that will be useful, too.

Warning:  Fast clicking can cause multiple animations to run at the same time.  Character direction can become odd-angled.  We should probably figure a way to disable clicks if/while an animation is currently running.

https://playground.babylonjs.com/#VZRN2V#5

There's another playground that someone created.  I call it "tank nav" because it acts like a military tank (with forward gear only).  The scene uses WASD keys... and has ANY angle allowed.  Maybe that will give you ideas, too.

Hope this helps.  Holler if you have questions.  Party on!

Link to comment
Share on other sites

 

Thank you for the quick and honest answer, but the playground-a is not working! This site can not be reached babylonjs.com's IP address could not be found. Google search for babylon js ERR_NAME_NOT_RESOLVED Maybe there is a problem with the hosting ... I hope soon to share a positive answer! Thank you!

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...