Problem getting variables from floor tiles

Retron84

Member
I've got a momentum based movement system set up, and I want to change the momentum variables based on the floor tile underneath the player object.
However, I'm only getting variables from one type of floor tile when multiple floor tiles are in the room.
In one screenshot you can see my code, and in the other you can see the room with my amazing placeholder programmer art. The black area is returning the correct default values, but every other tile is returning the slow tile's values.
The grey "D" area should also return the default values of the parent floor tile object, but it does not, it returns the values of one of the child objects.
This one really has my puzzled. Any suggestions?
 

Attachments

Your can't use position_meeting to check your collision as the position_meeting command returns true/false. It does not return an object instance. You need to use another command to check your collision. From the manual for position_meeting:
Description
With this function you can check a position for a collision with another instance or all instances of an object. When you use this you are checking a single point in the room for an instance or an object. This check will be done against the bounding box of the instance or against the mask of the instance if that instance has precise collisions checked. If you need to know get the unique instance id if the object being collided with you should use instance_position. This function also accepts the special keywords all and other.
If you use instance_position you will get the id of the instance, so use that function instead of position_meeting.
 

Retron84

Member
Someone else has helped me out with this and suggested using instance_place() instead of position_meeting() and it solved the problem.
Much thanks to Joel on the Heartbeast Discord!

EDIT: Thanks BaBiA, your help is much appreciated. Sorry I didn't refresh the page sooner!
 
Top