0 votes

I have a one shot particle effect that doesn't show up when I load the second scene to the right of the current scene. If I play the scene by itself the particle effect works when I run into an object. The Area2D "body_entered" still works, but it think's it's position is one screen size to the left so I have to do something like this:


const SCREEN_X = 480        

func _ready():
    glo = get_node("/root/global")  
    particle_packed = preload("res://env//script_obj//coin_particle.tscn")
    get_node("Area2D").connect("body_entered", self, "trigger_enter")

func trigger_enter(body):
    if body.get_name() == 'player':
        var particle = particle_packed.instance()
        particle.position = position
        particle.position.x += SCREEN_X * (glo.current_level -1) #why this
asked Aug 8, 2018 in Engine by talador (24 points)

What is glo and particle_packed? I don't see them defined anywhere.
Also I don't fully understand the problem or how it happens.
Is your coin_particle.tscn scene centered at the origin?
Also are you sure the position you set it to is actually correct, relative to the parent of your nodes? (verify what's local and global)

Please log in or register to answer this 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.