In this case, it seems simpler to just use the y position of the player.
Just find the bottom y of the fence and tell the player to stay below that.
if fence doesn't move vertically, use the actual y of the fence bottom.
if fence can move, use fencey=fence.y+(fence.height/2);
Whatever the number is, i'll call it fencey for this example:
then subtract the player height: fencey-=(player.height/2);
player>draw actor>
- Code: Select all
if(y<fencey){
y=fency;}
If for some reason your fence moves all over or changes shape in some areas and you absolutely must have a collision, just make a FILLED REGION actor and put it at players feet, to the size you want, then in the actor panel for the filled region actor, set parent to player.