[Solved] Character getting stuck

I want to get the character to fly all the way up on top of the screen, but he get’s stuck a bit up. Like there is an invisible wall. What am I doing wrong? I am using physics 2 engine only (no top down or platform behaviorI have tried the top down behavior before & I got the same issue. That is why I switched to physics engine 2. See GIF below

Stuck

You’ll need to provide screen shots of the events that move the character. We can’t tell why otherwise.

Hi,

Sorry, that is obvious :slight_smile:

In a previous event I have set the gravity scale to 0.
Here is the vertical flying event. See attached.
The thing is, I have the horizontal flying & there is no invisible wall at all. I can fly between left & right side of the scene. See second attachment.

I’m not sure if changing linear velocity is the right way to go about it. Usually a force is applied to the object. What happens if you change the linear velocity to apply force?

I tried force instead. Same issue. It is like an invisible wall. Everything works up to that point in the GIF. Both with Velocity & Force. I think the event program is ok. Is there any setting or something in the scene that is disturbing this?

Just to add information. The Scene is 1920X1080. If that have some impact?

It really sounds like there’s an object in the way. You could turn on debugging view and see if there is anything that’s blocking it. Use this action in a beginning of scene event and run the game in preview:

image


As an aside - with that screen shot you gave, unless the logical condition ‘OR’ is used, all conditions must be true before the action is performed. So the condition “If all these conditions are true” is not required.

Also, if the animation is “Flying Right” or “Right Lift off/Fly up”, then the animation cannot be “Flying Left” or “Left Lift off/Fly up” and the two negated conditions can be removed:

One other thought - are you using any extensions to limit the boundaries of the player?

Thank you!
I found a line. But I cannot understand why it is there? The background is a tiled sprite object. Why do I see a red line all over it? I cannot see it in the scene editor. Please see attached picture.

Thank you for helping me optimizing the code! I will try it after I have removed the red line. Do you know why is there?

Does the background have physics behaviour added to it?

I found the problem. I have an object under the player for him to stand on. It is connected with that! I tried remove the object, then the line disappeared. Thanks!!!

1 Like

No, the background doesn’t need physics behaviour.

Good to see you’ve sorted it :smiley:

Thanks for your help. Highly appreciated! Maybe I will have more questions further down the road. :grinning: