0 Favourites

Push/pull - object gets stuck at random

  • I have used this tutorial for push/pull in a C2 platformer:

    youtube.com/watch (loud music warning)

    It works really well, but there is an issue that I have that occurs at random. After a while, I am unable to move the object from one of the sides, unless I do something random like wall jump and then try again. It makes no sense because it doesn't seem to have a clear trigger to me. Anyone know what's going on and how to fix it?

    Here you can see it happening: youtu.be/fgkL-y9SyNw

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • You will have to post your capx, the tutorial seems rock solid to me.

  • Alright, here it is:

    dropbox.com

    /s/tcn0kghkj6qflrp/grody-pushpull.capx?dl=0

    (had to split up the link because it wouldn't let me otherwise, sorry for inconvenience)

    Note that this is my learning file, so there is a bunch of crap in the event, lol.

    Hopefully you can make sense of it.

  • You have that 'player.y > Tombstone.y' (player compare y) in both the PUSH and PULL group. (in the top condition)

    Well. See. The size of the player = 32*32. The tombstone = 32*32. Both origins are in the middle. Conclusion : Their Y should be the same (in a perfect world) when you push/pull because they stand on the same platform.

    This condition should never be true, and therefor the whole event should never be true.

    But. Positions in C2 go far in the decimals (like 45.458878884). Especialy when there are physics involved. Platform is a form of physics. Meaning: none of both objects is ever exactly 16 pixels above the platform. It is always near 16 pixels. Like platform y position + 16.01178 or platform y position + 15.8988.

    Conclusion: sometimes the players.y is heigher then the Tombstone.y, sometimes it is lower. Why it sometimes works and sometimes not. When you make the player jump, the player gets a new Y when landing. And again, sometimes his Y is lower, sometimes his Y is higher then then the Tombstone.y.

    Solution: offset the overlapper's orgin a few pixels towards the bottom. Now it should not collide on the bottom. And lose that condition 'player.y > Tombstone.y'.

    Not sure if you need it at all.

    You still have a few animation problems too. Hope you read trough the lines of my bad english.

  • Thank you so much, I think I understand and will give this a try later to see if I can get it to work!

    Yeah the animation problems I will look into after this

  • Tested it, and it seems to be working well. Haven't ran into the issue!

    Now onto the animation issues,... any idea what to do? Haha. Time to head to Google Thanks again for your help!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,515
DMT2005's avatar
DMT2005
Unread hot topic
0 Favourites
random bugs and suggestions
90 4,517
Tom's avatar
Tom Construct Team Founder
Unread hot topic
123 14,874
Zebbi's avatar
Zebbi