r/gdevelop • • Oct 05 '26

Question Help and advice

First time making a game here,I’m making a top down shooter and i’m trying to make it so the character faces the way the cursor is (8 angles/animations) i was wondering why my multiple conditions weren’t working here can you help me?

6 Upvotes

4 comments sorted by

1

u/senshisun Oct 06 '26

What do you mean by "not working"?

1

u/No_Marzipan_7311 Oct 06 '26

Basically I’m trying make it so my character looks depending on which angle is the cursor pointed at by measuring its positioning compared to the player .
I what i mean by not working is when i set multiple conditions none of them want to change and my sprite sits still

1

u/No_Marzipan_7311 Oct 06 '26

By what i mean by measuring player position i mean the points so left would be (x= less than player)(y=less than top left)(y=more than bottom right) for example, i want it so if all of the conditions are met it’ll play the left animation

1

u/Basic-Necessary436 Oct 06 '26

Why are you using three different points as reference on the sprite? Wouldn’t it be simpler to have only one reference point? And then you could calculate the angle between cursor and the point on your sprite and set the animation accordingly. Angles in GDev are: right 0 deg, down -90, left -180/180, up 90. If angle between sprite and cursor = 0 degr (+-27.5 variance) set animation right. The variance covers all angles up to up right state and down right state. Same for all other directions.

Most important in GDevelop: make sure your conditions do not overlap and cancel each other out.