Disable Edge Of Screen Collisions


#1

Hi,
I’ve started making an open world game and was wondering if there was a way to disable edge of screen collisions. At the moment, everything just gets caught at the edge of the screen when you move around. If there’s any way to do it, please share with me your knowledge.
Thanks :stuck_out_tongue_winking_eye:


#2

This mess happens!


#3

Have it disappear once hitting the edge.

And reappear if moved


#4

I’m pretty sure that causes the same problem


#5

Why don’t you try it?


#6

I just did. Any other ideas?


#7

Don’t use change x and y, or move forward. They can’t go off the screen.


#8

What do you mean?


#9

Use the set position and addition blocks


#10

I don’t understand your problem


#11

Look at the code in this: https://c.gethopscotch.com/p/zj5wy5rgk


#12

But the code is just fine! What’s the problem?


#13

Previously, everything would collect at the edges instead of moving smoothly


#14

I fixed the problem thanks to @Petrichor


#15

Move forward, change x and change y blocks do not allow the character to move outside the screen. This is not the case with set position though.


#16

I’ll also add that if an object is positioned off screen (using Set Position), any Move Forward will immediately snap the object back to the screen edge.


#17

Which was my problem.