object fall with alarm

K

kasm15

Guest
hi

i am making a platfrom game and wanted to make if the player hit the a object it change instance and it fall dawn
and it don't work it simply dn't change instance

script:






any tip
 

Slyddar

Member
Firstly, I suggest you give your sprites and objects names that describe the items. It helps you and others debug your code.
Secondly, what is in oParSolid and the step event that might effect the change?
 
K

kasm15

Guest
Firstly, I suggest you give your sprites and objects names that describe the items. It helps you and others debug your code.
Secondly, what is in oParSolid and the step event that might effect the change?
step event is really empty black script page and oParSolid is empty elsoit defened the soild ground and wall as soild
 

Slyddar

Member
it have a collison event with fall1
So player has a collision event with fall1, and fall1 also has a collision event with player. You only need 1 collision event, pick one object and have the collision event in one of them only.
 
K

kasm15

Guest
So player has a collision event with fall1, and fall1 also has a collision event with player. You only need 1 collision event, pick one object and have the collision event in one of them only.
did same same issue
 

TheouAegis

Member
If this is in Game Maker Studio, move fall1 up in the resource tree so that it is above oPlayer. Then test your code. If this is GM8, it won't work that way.


So here's the thing we're trying to get at, which in similar situations is the root of the problem:

fall1 is a child of oParSolid. Inside fall1 is a collision event with oPlayer that should be telling fall1 to turn into object284 (your falling platform). Collisions are checked in the order of objects in the resource tree. So if oPlayer had a collision event with fall1 or a collision event with oParSolid, it would be run first and then you would (presumably) move oPlayer outside the collision. So then when it's ofall1's turn to run its collision event code, there is no longer a collision because oPlayer's collision event code already moved it out of the collision.

Update: Don't make fall1 a child of oParSolid. See if the code works that way. If it does, then it's oPlayer's collision with oParSolid getting run before fall1's that is causing the issue.
 
K

kasm15

Guest
If this is in Game Maker Studio, move fall1 up in the resource tree so that it is above oPlayer. Then test your code. If this is GM8, it won't work that way.


So here's the thing we're trying to get at, which in similar situations is the root of the problem:

fall1 is a child of oParSolid. Inside fall1 is a collision event with oPlayer that should be telling fall1 to turn into object284 (your falling platform). Collisions are checked in the order of objects in the resource tree. So if oPlayer had a collision event with fall1 or a collision event with oParSolid, it would be run first and then you would (presumably) move oPlayer outside the collision. So then when it's ofall1's turn to run its collision event code, there is no longer a collision because oPlayer's collision event code already moved it out of the collision.

Update: Don't make fall1 a child of oParSolid. See if the code works that way. If it does, then it's oPlayer's collision with oParSolid getting run before fall1's that is causing the issue.
i Don't make fall1 a child of oParSolid and work great thanks
 
K

kasm15

Guest
but now other issue the object not soild and the player can went in it
 

TheouAegis

Member
Yes, because the player was handling his oParSolid collisions first. You could try making fall1 stop the player before changing.
 
Top