Hello, it’s been some time since I last posted. Some things have changed, just as the challenges did, namely how my player object shakes so much when using the “Move object away from object” event to handle collision in a top-down genre game. Example of such is provided in this link https://imgur.com/a/xC68q9D
When I force the player object against the blocker object, it is repelled in such a way that it shakes a lot, which would be highly undesirable. The best result would be for the player to simply not advance further from the point of collision with the blocker. Is there a way achieve that result? Thanks in advance.
It doesn’t happen in every wall, only certain parts. The isometric example is indeed very smooth in most parts, shaking the character only at corners. On my test room though, it’s mostly everywhere except a few parts not shown. I believe is has somehow to do with angles and such.
I have devised a solution and plan on implementing it soon to test. It involves a few tricks I used in an abandoned project. It involves creating 1 pixel wide or tall objects at each side of the Player hitbox, and reversing the conditions of “Object is in collision with object” and adding the second condition of “Key is pressed”. What I hope to achieve with this is to make the key that’s pressed to go up won’t work if the “Up” object at the top of the player hitbox is in collision with a wall/obstacle. Would be nice if there was an action called “Disable a key”.
I have made the tests I said I would, below are the results:
What I envisioned somewhat worked. I placed 4 different objects representing each side (though not overlapping the corners, very important) to detect which side is touching the walls. If it’s touching the wall, the events make it so the key to that direction is disabled. The events in question:
This is not optimal, but it’s better than before. I’ll attempt creating smooth collision employing other actions other than the “Separate two objects” as a collision handling technique, changing the type of the obstacles to “Platform”, though I’m not sure they will mix with the “top-down movement” behavior from the player.
EDIT: I’ve successfully made the ‘wiggling’ go away by setting the wall to be a “Platform” and the player to a “PlatformerObject”, though it only works on the X axis, the actions to simulate up and down key presses bearing no fruit in that regard. Help in making the player move on the Y axis as a “PlatformerObject” will be greatly appreciated, but for now, I’ll try to make the “Player” both a “PlatformerObject” and have top-down movement behavior.
EDIT 2: After some testing, I’ve discovered much of the vibration was due to the rate at which my player object accelerated (very fast, 999999 value to be exact, as I wanted instant acceleration/deceleration). I’m not sure where to go from now on. I’ll keep testing with lower speeds and see what happens.
The issue with the jiggling/wiggling/vibrating side effects have completely disappeared (even if the player is at high moving speeds) as soon as I made the following changes:
Changed the player object to “PlatformerObject” only;
Reduced gravity to 0;
Disabled default controls;
Set the obstacles to be “Platform” objects;
Added specific controls that adds an instant force to the player for all 4 directions;
Removed the “Separate two objects” action;
This way I’m able to mimic top-down movement with the advantage of not having to use the “Separate two objects”, which seemed to “repel” the player causing it to shake so much even at relatively slow movement speed. This works most of the time but new problems arose, which may require a new thread specific for that problem, so I’ll consider this issue with the shaky player object as solved.