Adding Physics behavior at run time

0 favourites
  • 8 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hi guys,

    is there any way to add or delete physics behavior to an object at run time.

    I have like maybe 50-100 physics object . and must of them are inactive all the time. they get activated when another object overlaps them.

    And if there is no way to do so, What is the maximum number of physic objects on the layer that don't affect the performance in mobile devices.

    And Can I have like 100 physic object which are immovable, I just use them with another movable object like a ball.

    Thanks

    Haroon Shishani

  • what about using immovable and movable?? so you set at the start to immovable and when the object collision with them it change to movable ^^

  • Yes it sounds good idea.

    So when the object is immovable, does it mean I can have as much as immovable Physic object with no performance lack issues.

    I just wanna know What is the maximum count of immovable physic objects is recommended to have.

    And Thanks zsangerous for your reply :)

  • No idea if physic objects use up space when not being computed, but if they do just use placeholder sprites for the location of the objects, and destroy the placeholder and spawn the physic object upon collision?

    To account for the physic effect being affected, the placeholder could have it's hitbox invisible and slightly larger than the actual object, so the physic object would be spawned before genuine contact.

  • see first of all if the objects doesn't have alot of animations you can combine them into 1 object it will be better than 100 objects. also you can use as much as construct2 limit can hold , but yes put a variable to the objects so not all of them will be movable when you hit 1 of them ( put a boolean)

    boolean = true ---> movable

    boolean = false --> immovable.

  • E Bear , you idea is good but it will lower the fps so the variable and events are better than 3x objects while he is using 100 objects

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • actually the placeholder object is probably the best approach for me since my 100 objects are exactly the same.

    it's sounds very good idea to use the placeholder, I will diffidently try it.

    And I have another scenarios to use the Immovable property that would work great :)

    Thank you guys

  • I just wanted to say it worked great, when the distance of the ball and the object is with in a specific range i create the placeholder object in the position where the ball fall, and I destroy the object when the ball leaves that distance :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)