Hello. How do you set the Characters position relative to the scene it’s in? Whenever I try to setPosition(x,y,z), it’s either moving it based off it’s origin or the world coordinates. I’m just trying to set it’s position based on the object it lands on in that scene. Any help would be appreciated. Thanks.
If I understand you right could you mot get the position of the object you collide with and use that to set the characters position?
Yeh that’s what I’m thinking, but how is that achieved? It’s very hard without any documentation. Thanks.
Here this code will get you the object you collided from. Just hook up an "If Collide" node in you r character to a script with this in it Code: let collideNode = this.entity().component('If Collide'); let collisionObj = collideNode.collisionObject(); log(JSON.stringify(collisionObj.position()));
Thank you for posting. I’m just struggling at resetting the Characters position using the values. It seems to move the character out of the scene or something weird.
Dig into the 'Sticky Sphere' Asset within the Asset Library... everything you need is in that asset. It references the collision object and then recreates it as a child of the original object... cool. Good luck. B