About collider & Pin [Solved]

0 favourites
  • 9 posts
From the Asset Store
Pin UI
$1.50 USD
40% off
Create a perfectly Pinned Interface for Any Device
  • Hello :)

    i've searched about my problem but i've not found the answer...and a recent answer...so, a platform, super mario bros style.

    im wondering if there is a simple method to pin a collider on a mob(to do same as mario head squish) and doing this for every instance.

    I've created a container with collider spawned on an image point but when i hit it i kill,obviously, all the mobs.

    Also it's genuine using every tick to set position of the collider? is it a waste of resources?

    Thank you in advance. :)

  • Use containers: this will ensure that each mob gets a collision box when it's created, and when one dies, so will the other.

    The simple method to pin a container is with the pin behaviour. So do something like this: when the mob is created, position the collision box to it, and then pin the box to it (two separate actions, same condition). With containers, the box is automatically created when the mob is created, and the correct instance of the box is automatically picked when you pick the mob.

    Pinning and assigning position every tick are identical in terms of functionality and resource usage.

  • i was using spawn instead of set position, now i've understood..thx!

    now the instance works but it doesnt stay pinned... O_o

    i've set pos & angle. it look so simple,damn! maybe im a moron.

  • Have a look at this example.

    Just for example's sake, I've assigned the PlayerBox the platform behaviour so you can see how it moves, but in your game you'd obviously have some sort of custom AI movement set up for your mobs.

    The way you should set up your colliders should be the same, though. Notice that the actual box is the object that's controlled - the sprite is simple pinned to it. The box would be invisible in a proper game, though.

    Also worth noting is that when I pick the sprite (On Created) - it automatically picks the correct collision box in the pin action; this is the beauty of containers.

  • i dont have 124, but yes my player is a box with animation pinned to it!

    But the condition is On start of layout! i've just changed it with "on creation" of player(box) and is not pinned anymore...so maybe is that the problem.

    Pin doesnt work with that, cause it's just on created container mob set posit collider and pin it. :/

  • i've changed with on start of layout and the collider was pinned to mob...but when the mob(bullet) bounce on solid...the collider continue to go forward. :/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe...maybe i've solved using "Is Visible"

  • Download R124 and check out my example. It's dead simple - a single event. You should generally stay up-to-date anyway.

  • now it works, maybe it was the 119 ver. i dont know,but was the same of your ex.

    thank you.

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