body class functions


Recommended Posts

image.thumb.png.2138f97e2af2c6c38075a84fa351b00d.png

 

Are these functions related to node transform?

 

image.png.5d4f55a0cee1e7a859f3d6187a8aa48e.png

 

Or shape?

image.png.128c399a36a3b09edf00e9a6d6397626.png

 

 

2.

I'm simply trying to switch walking and idle animation when a human object moves and stop.

Is the body class the only way to capture the movement of an object?

 

Edited by dongju.jeong
Link to post

Hello,

When the setTransform(), setPreserveTransform() and setVelocityTransform() methods are used, the node transformation is affected. This doesn't change the transforms of shapes, as they are stored in local transforms relative to the body. The position change callback is called when body, node, and shape transformations change. Instead of a callback, you can try comparing the position of the node in the previous and current frames:

if (MathLib.Compare(node.WorldPosition, node.OldWorldPosition) == 0)
{
	// position changed
}

 

  • Like 1
Link to post

thank you.

Currently, we are working on a simple comparison of object locations.

Link to post