0 votes

In my project the platform ( tilemap ) spawns as the player moves. But the platform only spawns as the player moves backwards . It doesn't spawn as the player moves forward. Can anyone please tell me how I can instance the platform as the player moves forward ?

Here is the project Spawner
Here is the video which I used as reference video

in Engine by (55 points)

1 Answer

0 votes
Best answer

Can anyone please tell me how I can instance the platform as the player moves forward?

In spawn_Ground.gd change the sign of GROUND_HEIGHT so it looks like this:

func go_next_pos():
    set_position(  Vector2(0, -GROUND_HEIGHT) + get_position() )

In Node2D.tscn reset the position of the bottom_right-node back to (0, 0) - now it's actually in the top-left - and then change the condition in the script to this:

func _process(delta):
    if bottom_right.get_global_position().y > camera.get_total_pos().y:
by (10,315 points)
selected by

Thank you so much for your assistance.

Can you please help me as I have got one more problem.
I have posted the Question

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.