When the room's physical function is turned on, some functions such as coordinate movement cannot be(resorved) used.

uni00

Member
When displaying the effect and moving it to the specified coordinates, move_towers_point(); is sometimes used, but that function does not work as long as the physics function is turned on. What should i do?How can you create a performance in which the player gains experience from the enemy?
 
Unless your game 100% needs physics or it will not function, then I'd recommend turning off physics. It makes a lot of things unusable, amongst them the ordinary movement commands in GMS. If you're determined to use physics, you'll have to switch to finding directions and distances and using physics impulses or forces to move things around. Get used to working with vectors and angular momentum and all those terribly fun physics things from your school textbooks, instead of with simple functions like "move_towards_point".
 

uni00

Member
Unless your game 100% needs physics or it will not function, then I'd recommend turning off physics. It makes a lot of things unusable, amongst them the ordinary movement commands in GMS. If you're determined to use physics, you'll have to switch to finding directions and distances and using physics impulses or forces to move things around. Get used to working with vectors and angular momentum and all those terribly fun physics things from your school textbooks, instead of with simple functions like "move_towards_point".
Thank you for your reply. Is there a function that can temporarily turn off room coordinates?
 

uni00

Member
I'm sorry it's hard to understand. I will paste this image. I've attached the physics to the room itself, not the instance, which creates a game with puzzles falling from the top. No instance can use some coordinate functions because the room itself is in the physical world.
 

Attachments

Oh, you'll need to check the Physics box on pretty much all the objects you are placing that room I believe (I don't use the physics system much).

As I said, a -lot- of things are going to change when using physics, so you'll basically have to relearn everything you've learnt so far. You should not change positions of instances directly by using their x and y variables, you'll have to start using physics_apply_force or physics_apply_impulse to move things. You CAN change the position using phy_position_x and phy_position_y but this is NOT RECOMMENDED as it can create errors within the physics system (just like the real world, if you teleported something from one place to another by simply changing it's position magically, all sorts of bad things could happen).
 

uni00

Member
Oh, you'll need to check the Physics box on pretty much all the objects you are placing that room I believe (I don't use the physics system much).

As I said, a -lot- of things are going to change when using physics, so you'll basically have to relearn everything you've learnt so far. You should not change positions of instances directly by using their x and y variables, you'll have to start using physics_apply_force or physics_apply_impulse to move things. You CAN change the position using phy_position_x and phy_position_y but this is NOT RECOMMENDED as it can create errors within the physics system (just like the real world, if you teleported something from one place to another by simply changing it's position magically, all sorts of bad things could happen).
Hmm. .. .. After turning on physics, you have to move effects etc. within the range of physics. .. .. Thank you very much.
 
Top