0 votes

So basically if your character exits in the left they appear in the right.

I know ofc you can make a somewhat similair effect by simply changing their position, but it's not really looping since if you're standing right at the border, instead of half the character appearing in the left and the other in the right, you'll only be on one side.

in Engine by (55 points)

1 Answer

0 votes

This could be done with 9 cameras render on top of each other in a 3x3 grid but I would have to look into the details of alphamasks or maybe a shader.

But if you only want one simple sprite to render on the opposite screen edge this would work:

func _process(delta):
    ...
    update()

func _draw():
    var rect_center = get_rect().size*0.5 
    var view = get_viewport().size
    draw_texture(texture, Vector2( view.x, 0) - rect_center )
    draw_texture(texture, Vector2(-view.x, 0) - rect_center )
by (911 points)

Unfortunately not. It's a KinematicBody with more than one sprite attached.

Could you explain the 3x3 grid idea? I suppose that it would work in the way that if your character for example exits the bottom left cameras view to the left, that part will be drawn in right of the bottom right camera. But I don't know how to actually do this.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.