Object rotated towards player, more angles

Hello, I need to change animation of object according to its angle towards player (like in old-school pseudo 3D FPS characters . like doom etc…sprite for each direction) Yes, there is “object is turned towards another” condition, it works, but I can use it only for two angles (one if facing, and other same condition but inverted), but I need to check this condition for minimum 4 angles - front, back, left side, right side… I hope its at least bit understandable…

Hi, I am not really sure how to imagine the setup of your scene so maybe my suggestions are not useful.

One possible, easy solution is to add small, hidden sprite-objects to the different directions of your player. This would allow you to use the ‘An object is turned toward another’ - condition for more than just two cases.

Another possibility could be to use raycasts, but since they represent just lines you might need more than just 4 of them.

Thank you for reply, basically I need something like this 3D 8 directional sprite rotation based on facing direction relative to camera direction - General and Gameplay Programming - GameDev.net

I see. Unfortunately I have no experience with pseudo 3D. Here is a post with some examples (in case you don’t know them):

Do you have a specific reason to make this kind of game in Gdevelop? It seems to be quite tricky to do and there are other dedicated engines out there that allow you to do this kind of stuff without much headache.

Thanks you! In fact I recently discovered this - WithThreeJS Extension for GDevelop by PANDAKO … So it seems that simple 3D games will be possible (or are possible already), its very cool extension, but this directional sprites would make it much more useful for me…

Hi,
If I got you right, you’re supposed to add your animations in rotating order, and then do something like: change animation to angle/90 (for 4 animations) or angle/45 (for 8 animations).
I think the isometric platformer uses that system, take a look. Except that instead of the player angle, you’ll need to use the “Angle between two objects” numerical expression, I presume.

Thank you! Topic name is bit confusing, maybe its name should be something like - 8 directional doom like sprite… Im already able to change sprites according to the objects angle, but for me problem comes when It needs to reflects players angle/view… I made little this little
8directional sprite
image for better understanding…

Either you find the right formula to compute the proper angle and display the adequate animation, which shouldn’t be too hard with a bit of trial and error, either you add four little objects around your sprite, and use the “turned towards another” condition with each one to trigger each animation.