Jump to content

Animation


Richard C
 Share

Recommended Posts

Help again please.

I want to animate an object in two vector x and y (usually to move an obj diagonally across the canvas).

var animateSub= new BABYLON.Animation("tutoAnimation", "position.x", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.ANIMATIONLOOPMODE_CONSTANT);

How do I set the target property to both .x and .y simultaneously and how is the value represented in each key ie value:

Thanks again

Richard C

Link to comment
Share on other sites

Hi RC.  Change "position.x" to "position"... and change "ANIMATIONTYPE_FLOAT" to "ANIMATIONTYPE_VECTOR3".  Now take a fresh look at the world of animation (and do some playground searches as needed).  :)

Actually, the playground searcher couldn't find "ANIMATIONTYPE_VECTOR3" if it was lit in neon.  :D  Oh well. 

Our playground search might be at the mercy of some admin folk at Azure.  Them Azure folks seem to have something against periods and underscores in their search terms.  :)

All in all, here's a PG :  http://www.babylonjs-playground.com/#11ZVTO#4   See line 33.  Party on. 

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...