Saturday, October 1, 2022
HomeGame DevelopmentPhysicsX sprite youngster not following guardian - Cocos Creator

PhysicsX sprite youngster not following guardian – Cocos Creator


hello guys, i’m working with physicsX on IOS and i’ve a prefab with a guardian node that has a Rigidboyd and colliders. this node has some childs with some sprites. Within the editor every part is working nice, however as soon as i make a construct for IOS, the rigidbody (the guardian) is falling nice however the sprites doesn’t transfer.

If i set the sprites place manually within the replace all works nice once more. i’ve learn related points just a few years in the past. Any clue about what’s occurring? If i alter to a different physic engine all works nice.

Thks guys, any assist will probably be admire.


 replace()
    {
         
        this.childrenPosition(this.node);
    }

    childrenPosition(youngster)
    {
        youngster.setWorldPosition(this.node.getWorldPosition());

        for(var i = 0; i < youngster.youngsters.size; i++) {		// iterate by way of youngsters by index
            //reposicionar el nodo mirar sus hijos y rellamar esta funcion para cada uno de ellos
            var youngster = youngster.youngsters[i];
            this.childrenPosition(youngster);
        }
    }

Simply in caso others have the identical challenge, i’ve solved it with that code within the guardian node that has the rigidbody and the collider

I can’t fairly think about your state of affairs, are you able to present a easy demo to breed this?

Hello!,
Please have a look this dialogue:

To breed it simply create a brand new scene, set the undertaking config to physicsX. Create a sphere with rigidbody and collider and as a toddler (one other node) create a standard sprite. Within the editor the gravity will go nice and the decision will go down with the kid and the sprite. For those who make a construct for ios, you will notice the ball falling down and the sprite simply quiet in the identical place that was spawned. that’s as a result of the guardian rework is affected by gravity however the youngster will not be following the guardian.

Thks.

Thanks, I’ve reproduce this challenge, and can repair it asap

similar this challenge on cocos creator 3.6.0x

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments