can any help me for some reason when i put in Player.CenterX()/Player.CenterY() for my enemy to rotate to look at my player it never looks my way it look to a area away for my player and I don’t know why
(if it helps it for a top downshooter game )
How is your Player’s sprite?
Is it very big and only a few part is colored and place near sides?
[edit]
I read your post again and you are getting Player’s Centre point wrongly. You need to use Player.CentreX() and Player.CentreY() but instead, you are using Player.X()Centre and Player.Y()Centre
Alternatively, it can be also Player.X(“Center”) and Player.Y(“Center”).
sorry i am typing it that way. i just accidentally did it wrong but it doesn’t work that way for me
Please take a screenshot showing your actual events, and a screenshot showing your object that you are trying to rotate. We can better assist that way.
In Windows, you can take a screenshot by pressing the windows key + shift + S on your keyboard.
(Please do not post phone camera photos of your monitor)
Are you near the Zombie?
[edit]
GDevelop does Rotation like this.
So, your sprite facing is facing up in 0 degrees and on 90 degrees, it faces to the right and same for all other angles.
To clarify, we need the object settings in the object editor, not the scene/preview. Like when you set up the object animations.
Almos in that screen click EDIT POINTS.
@Muzan is right with the rotation of the sprite. The side that should face the player needs to be adjusted to 0° (to the right) in the frame as shown in the diagram.
Is your image 2048px? if not
Well you ca try moving x,y to 0,0 then try the rotation in events, if that doesn’t work then move point x/y to the center of the image and try rotation event
@Demon1071 - the problem you have is probaly not caused by your player sprite. According to your events the player is probably the round thing with arms (the sprite you posted) . You mentioned that enemy (zombie) is not facing the player properly, so you need to adjust your zombie sprite by default to the right or 0° in your animation frame.
edit: in my edited post I thought the posted sprite is the enemy
edit2: I guess the green one is the enemy/zombie after all.
This is what @Drona means. Edit the image file so it looks like :
oh thank you it now works thanks for the help
can someone please help me? I’m making a game using Gdevelop, but it glitches every few weeks. Whenever it glitches, I have to create my sprites again. I’m not sure why this happens.
Hi Elizabeth. It’s best to start a new post than add to one from 2 years ago. In it, explain in what way it glitchs. The more specific the better.
Sorry, I don’t know how to start a new post.