now I might have made the second code wrong... so let me debug it... *debugs* actually the code is correct, I was able to implant it in a second in an old game of mine.
if you're having problem with the MP_Dir, here's an addition of code you can use with the provided codes:
- Code: Select all
int MP_Dir;
if(xvelocity>0)MP_Dir=1;
else if(xvelocity<0)MP_Dir=-1;
Now this will detect which was the last position the player pointed to depending on his speed.
Well my code will not fix your parenting issue if the player you need to follow is parented to something.
The view shouldn't be parented to anything either.
Also make sure that the code is inside the player's draw actor, if the player is parented to something, put it in the parent of the player instead (like if you have a collision mask actor).
as my code uses x/y coordinates and not xscreen/yscreen coordinate
Now the code could easily be modified to work with screen coordinates rather than actor coordinates by adding "screen" to all the x and y variables.