Tomycase's Forum Posts

  • Glad that it worked!

  • drive.google.com/file/d/1f-3B5F73j5bcxilIekIYixKFzt8HEZvT/view

    I made a first fix with some code optimisation :

    Replaced the character movement with 8-Direction;

    Placed all the falling objects sprites in a main object called "Ingredients" as animation frames with speed = 0, the animation frame is set after the global variable that was previously used to pick which object to spawn;

    On landed triggers the falling objects to pin themselves to the player;

    No slow movement on the player part, the objects follow its position correctly, only one problem currently is that the falling object can pin themselves to the pile from the sides, might need another approach to this method

    EDIT : Second fix, this time the solid behavior is removed from the falling object, a pilechecker object is placed on top of the pile at last object which collided with it position

    drive.google.com/file/d/1bEVDMtOjxXOHEeitsryq_vp9wjl21ebp/view

  • Now that's very weird, I'll see if I have some time to inspect the file later on

  • Ah you meant the slow moving to the right, I think it is because of the player colliding with the boxes while moving with them at the same time, it creates a friction, try to disable solid behavior on the player and pin the first box by checking "On collision with another object" instead

  • You do not have permission to view this post

  • As I said, 8-Direction is not to fix the problem;

    Now if you're already using plateform for the boxes that's perfect, you just need to use "On landed" condition in the events, then "Pin to Object" to pin it to the player object

  • So as long as the tray is on screen it's fine, no need for clamp then;

    Also I didn't suggested the 8-Direction to fix the box falling problem, only to make the movement management more streamlined, to fix the said problem, the pin behavior should fix it, by checking when a box collide with the tray or another box, pin it to the character position;

    However there is just one tiny problem, without the family feature, there's no way to check if a box collide with another box correctly, because C3 wouldn't know which one to pick and pin to the player, there's a solution however : have an invisible object that is placed on the tray and follow its X coordinates, that would check when a box touch the top of the pile;

    Each time a box touch that checker, it is pinned to the player, and the checker is moved a few pixels up, do you see what I mean?

    EDIT : Nevermind I though of a simplier solution, what do you use to make the boxes fall?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok so, the way you handle the collision is actually not a bad idea, you should just limit the polygon points to 4, basically a flat rectangle;

    Now for the movement behavior, I think 8-Movement is more adapted to your need, you can even limit the movement range to Left/Right in the parameters, be sure to toggle off "Set Angle" tho;

    Going back to the collision polygon, one problem that adds to the pile is how to prevent the character to go out of boundaries, for that the clamp expression can be useful, are you familiar with it?

  • Hey there, I can't check your project rn but I watched the two videos, for the blocks falling of the plate, you should use the pin behavior to pin them to the character, so they will follow their movements, now for the character moving slowly to the right, have you checked the character collision polygon in the image editor? Also which behavior do you use to move the character?

  • Hey there, it's probably because the engine considers that the character is falling in this situation, try to add this inverted condition "is overlapping [moving plateform] at offset" with a few pixels Y offset in the fall event

  • Hey there, that's how most of the behaviors working with vectors work in C2 and C3, it can be used in useful ways as well, for example, you can prepare your Vector X and Y values early and then enable the behavior when needed, it will apply immediately the previously set values

  • That's the solution I proposed lol

  • Instead of just comparing the variable, use "Pick by comparison" to pick the box with the same variable, then pin

  • I personally can't edit more on the file as I don't have the full version, and I can't localise the event messing with the bullets with the limited version

  • Oh that indeed makes sence now that I can visualize it, thanks for the explanation, I'm going to experiment more with it ~