Creating Object to specific location doesn't work

I’m trying to create an object at exact coordinates X: 34704 Y:-2628, but the object gets created away from where it’s needed. I’ve hovered my mouse over the location to check it.

It would be better if you could show us some print and your code. Is the object too far away when it’s created? Instead of testing only with your mouse place the object exactly at these coordinates in your scene. Remember: it will place the object using your “origin point”.

Can you provide a screen shot of what you mean? And how are you checking with the mouse? Are you displaying the co-ordinates to screen?

You could run preview in debugger mode, and check the object’s position.



I’ve tried getting them to turn around (the reaper is the computer character). I tried using the instructions in the platformer guide, but he’d just stand still after getting to the left side. I am trying to fix it by having the original be deleted and another created in its place, which will then be moving to the right. The right side will do the same creating and deleting to make it go left.

If you see in the first screenshot I hoveryouse where I want it to basically create it (I got the coordinates from the bottom left.), but it moves to the center as you can see in screenshot 3.

I’m not using the mouse to do anything. I only used it to see the coordinates I’d need to put it. Using stop on the character won’t let them move again and I’ve tried using the tutorial for platformer, but he just stays in place when he gets to the left. That’s why I’m trying what I’m doing now.

That’s because you are forcing the player to the left with this unconditional action :

Also note that instant forces only work for the one frame they are used. If you want a continuous force, change the instant to permanent.

I just redid it using the tutorial and I still haven problems. Either the character stands in the one spot, or the flip like I want but they keep going the same direction.

Using a permanent force won’t work either because it just goes too fast, even if I use trigger once or not.

Is there any way to upload my project here to let you check it out?

Can you give us another screen shot of your events, like in the post earlier? There are probably still some fixes we can help.

Here you go. Sorry for the wait, I use my phone for the forum so I have to use usb to send the screenshots from the computer to my phone.

I copied this Platformer Tutorial, Part 6: Add Enemies to the Game [GDevelop wiki]

Why are you settnig the direction to “right” when it’s “left” and there are no collisions?

That’s how the tutorial did it. It didn’t have a collision at that part.

No it doesn’t. Here’s the last code screen shot from the tutorial part 6 :

The first part with slime says only variable. I was going by that. I switched it to the opposite to get the direction I need.

All that tutorial is doing is making a slime character move back and forth between 2 markers.

It does this by setting the direction the slime should head when it hits a marker.

It also determines which way to apply the force depending on the direction the slime.

But with your one, you switch it to going right a few events after you’ve changed it to left.

Why do you want the reaper to go right when it has just turned around? the reaper will just collide into the deathleft object and have it’s direction to left. This cycle of changing direction wil go on and on.

That’s what I want it to do. I couldn’t figure out how to make it follow the player without going through the ground. It’s supposed to be a fight and I figured this would probably be the best way to get him to move side to side to look like it follows the player. I don’t know how to get it to move to the player otherwise.

There are a multitude of examples here showcasing GDevelop’s features.

For a chasing type behaviour, you can use pathfinding. One of the examples is labelled “Basic ai with pathfinding” (do a search on the page for pathfinding, and it’ll be the 3rd find result). You can edit the project online and see how the events work.

Ok I’ll give it a try. Thank you!

Wow that worked amazingly! Thank you.

I do however now need to figure out how to flip the reaper when he turns a different direction. Since that’s a different topic I’m going to ask it in another question.

I hope you have a wonderful day/night and stay safe!