Legacy GM [SOLVED]step_avoiding and physics

A

Andrea N

Guest
Hi all,
I have a physic object, an obj_enemy that follow the player.
I need to use mp_potential_step(x,y,spd,true) to make sure that the obj_enemy avoids the obstacles, but mp_potential_step works only with x and y, and not with phy_position_x and phy_position_y!!
How can i do this with physics objects?
Some idea??
Thanks
 

Amon

Member
Can't you just store the current phy_position_x/y in x/y?

x = phy_position_x
y = phy_position_y
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
You need to code your own movement code, as the physics system is totally separate from the regular movement systems. To be honest, if you are using this function or think you need to use this function you possibly don't need physics... Physics is designed to be used for continuous simulation and as such you should be using forces and impulses to move the instances... In the "real" word, things don't move magically in "steps" and increments, and physics is meant to simulate the real world. ;)
 
A

Andrea N

Guest
Can't you just store the current phy_position_x/y in x/y?

x = phy_position_x
y = phy_position_y
I'm in a multiplayer game and obj_enemy have the phy_position_x and phy_position_y from the server.
Example:
phy_position_x = server_enemy_x;
phy_position_y = server_enemy_y;

I can't use this: mp_potential_step(phy_position_x,phy_position_y,spd,true), this function works only with x and y.
 
A

Andrea N

Guest
You need to code your own movement code, as the physics system is totally separate from the regular movement systems. To be honest, if you are using this function or think you need to use this function you possibly don't need physics... Physics is designed to be used for continuous simulation and as such you should be using forces and impulses to move the instances... In the "real" word, things don't move magically in "steps" and increments, and physics is meant to simulate the real world. ;)
I use physics only to make the objects collide each other and slide/slips.
I tried without physics and use "solid object" but when them collide they stops to move!!! So i need physics, or are there other methods to collide and to slide?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Using physics in this way is all wrong... and it'll lead to more than one issue, especially if you are doing an online game, as the physics system is NOT determinate! You can start with the exact same conditions every time in a room, and yet every time will have different outcomes. I would suggest that you learn to code your own collision system using the regular movement variables and techniques (hint, don't use "solid").
 
Top