dongju.jeong Posted March 8, 2021 Posted March 8, 2021 (edited) Are these functions related to node transform? Or shape? 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 March 8, 2021 by dongju.jeong
karpych11 Posted March 9, 2021 Posted March 9, 2021 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 } 1
dongju.jeong Posted March 10, 2021 Author Posted March 10, 2021 thank you. Currently, we are working on a simple comparison of object locations.
binstream Posted March 10, 2021 Posted March 10, 2021 Maybe physical trigger will be useful here: https://developer.unigine.com/en/docs/2.13/objects/effects/physicals/physical_trigger/
Recommended Posts