Animations not retaining physical properties such as collisions. Need help please


#1

Video link
I have created this video to highlight my process and problems.


#2

Yes it dosent work once animated it becomes none physical
I tried making an elevator a while back had the same problem and was told that u have to script a solution
which to me seems a lousy solution

also parenting an entity to an animated bone also dosent work

which leaves us in a world of hurt and unnecicarry complexity


#3

I just made a basic elevator. with no scripting at all. No animations.

Place basic entity cube. make it 5x5 meters in my example.
And set linear settings.

Now, to make a real elevator you need some scripting yes. But it sounds like pretty basic scripting. Still to difficult for judas :\


#4

There has to be some other method. Who said that you have to script it?
I saw your elevator example in the other thread which is spot on with the problem I am having. It just seems overly complicated.

Do I use the asset url for the animation url?

And is there maybe a good Clara model that is animated with physical properties that we could base our designs off of?


#5

How does this work? Does it just move on the Y forever? Does it reset?


#6

I just suggest test it. Now it keeps you moving up in the Y direction until you stop it :grinning:


#7

If I look at https://wiki.highfidelity.com/wiki/Avatar_Animation_Basics
is there a way to apply this to a non avatar model.

In the line
MyAvatar.overrideRoleAnimation(“idleStand”, ANIM_URL, 30, true, 0, 53);

is there something like ObjectName.overrideRoleAnimation?
Could I insert a fbx model from my assets there instead of “MyAvatar”? And then I could animate it with the script seen on that wiki page?


#8

What @Richardus.Raymaker was suggesting was using the physics settings to move the object up and down to make an elevator.

Basically the truth is you must have a script for an elevator, because how else does it know when to stop? Ofcourse you can calculate the impulse and use friction to stop the elevator, but its only one direction. Anything more complex will need something else.
The one he mentions there it will just keep going up forever.

With Scripts you have a couple of options

  • Have a detection script to bind the avatar to the animation bone so that they get animated with the entity among other things to make sure physics are off and stuff.This is the most reliable way of moving people with animations, but you still need to be able to stop the animation, and move the collision hull on stop to the current location.
  • Detect when the entity is at a certain height, and hit the breaks by allowing linear damping to slow the object down, also if thin entity, best have avatar also parented to it for best effect.
  • Have a separate entity follow the bone, but is not parented to the entity allowing it to move freely. But in this case, it requires control on who currently runs it.

As of the moment animating via bones also wouldn’t work because the world position of the entity and child attached are never updated because entity animations are NOT server side, they are visually shown on client end, and sync is done in the frame. Its also not very reliable, How do you know the animation has loaded for everyone or exact same frame? or how do you know the user hasnt skipped a couple of frames, and suddenly they are below the object as its moving up?

Tech issues aside, if they made a collision hull entity that would update with the animation, perhaps, but not right now.

The entity parented to the animated object is still just a child of an object that has an animation property. No other values of the child or parent update at all, so essentially, the server sees and transmits them as stationary, so their position, size and rotation never gets updated.


To answer your question of animating entities. Entities have no roles nor any animation scripting interface. Instead it is an property.

The Edit.js pretty much updates the animation properties. Animations on entities work with this method as its the only way they stay in ‘relatively’ insync, unlike avatar animations which get streamed.


Entities.editEntity("<id>", 
{ "animation": {
        "url": "<url>",
        "fps": 30,
        "running": 1,
        "loop": 1,
        "firstFrame": 1,
        "lastFrame": 119
}});

This sets the animation to be of url, and start running it. to stop it, one would then use


Entities.editEntity("<id>", 
  { 
    "animation": {
      "running": 0
    }
  }
);

If you want to have multiple animations, you can, and should use a single animation file, but have the animations in different sets of frames.


#9

Does it really need a script? I just found a crane model in one of the random HiFi worlds that slowly spins in a 360 degree circle. It is set for collisions and if I float my avatar up then it will push my character in the circle. There is no script attached to it. I imported into my sandbox and it worked fine. Not sure why this works but my tests do not.


#10

I guess you mean the crane on PLAYA. I think that one use the rotation properties you get with the entity


#11

Yes that is the one I was referring to. Could you explain rotation properties. How is this different from an animation? And why does this maintain physical properties but an animation does not?


#12

Angular Velocity and Velocity are properties which give an entity motion, and are not per say an animation. You can set an simple entity or an model entity with a defined physics hull to have these properties and effect others.

  • Velocity is affected by Damping, which is like “friction” (slowing down the velocity over time),
  • Angular Velocity is affected Angular Damping, or like friction for rotation. this is also effected by Registration point, which also behaves as a pivot for where the object will rotate.

You can set basics of these values with the edit script.