Discord
Login
Community
DARK THEME

Collision

i am no so good but i am trying learning a detect collision, BUT i know a bit of this.

PLS dont only put a link AABB

Detect how far a player is from the centre of an object. If they get too far in, teleport them out of the object.

Example:

// In this code, positive X is right.

if player.x < 60 then

player.x = 61

end

// I made this when I was super tired so sorry if it doesn't make sense

o well, i think i could help you.

i maked an example documented to you and also i'm brazilian so english ins't my first language so excuse me any mistakes.

https://microstudio.dev/i/warrior/collisionexample/

use the arrow up, down, left and right to move the pruple charachter and the W, S, A and D to move the red charachter.

i hope you enjoy.

:embed https://microstudio.io/warrior/collisionexample/

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community