Open maunovaha opened 1 year ago
IMO it would make sense for move_and_collide to automatically filter out the calling instance, just like functions such as place_meeting do. I can't think of any possible scenarios where you'd want an instance to move_and_collide with itself, since that just makes it not move. So I think this could be the default behavior, no option needed.
Hi @maunovaha I've run some tests and from what I can see, move_and_collide already ignores self, I think that there must be some other problem with how you are calling move_and_collide - check the attached sample where all the moving objects are of type Object2 and the player object will collide correctly with the non-player controlled instances and ignore itself.
Is your feature request related to a problem?
I am atm. programming simple game server prototype for a RPG and I want to move players around the colliding objects using the
move_and_collide
function. I want players to collide with each other and tilemap objects, so I have decided to create an array ofm_CollisionObjectTypes
that can be used withmove_and_collide
function.However, the problem is that the player seems to collide with itself and cannot move at all. Atm, I am not sure if this is intended behavior or not but it makes it very hard to use the function effectively. Below is a simplified version of the code I am using:
I have also tried to call the function using:
var collidingInstances = move_and_collide(xDistanceToMove, yDistanceToMove, obj_NetworkPlayer);
But the same problem persist as long as the player is trying to collide with other players. I am using the latest game maker version 2023.8.2.108 (ide) and 2023.8.2.152 (runtime)
Describe the solution you'd like
In this context, the player should not collide with itself or there should be possible to call the function with an additional parameter that can be used to ignore the player itself from the collision.
Describe alternatives you've considered
No response
Additional context
No response