0 votes

I'm basically making an online multiplayer game where players fly using balloons and they have to pop the other players' balloons to win (like Balloon fight), to pop them you have to step on them.

Players' feet and balloons are Area2D, and to pop them I make that if an area that is in the group "feet" enters the area of ​​the balloon, a queue_free is applied to it.

My problem is that there are times when on my screen I pop the balloons to another player and on the other player's screen that does not happen, so I can see the other player flying without balloons. Which makes me think that it is a problem of non-concordance of the positions on the screens.

This is the part of the script that takes care of the movements:

func _movimiento():
var Vx = 5
if is_network_master():
    #movimiento en X:
    if Input.is_action_pressed("ui_left"):
        velocidad.x -= Vx
    elif Input.is_action_pressed("ui_right"):
        velocidad.x += Vx

    #Movimiento en Y:
    if Input.is_action_just_pressed("ui_up"):
        velocidad.y -= 50 * globos

    var g = 5
    velocidad.y += g

    rset("puppet_pos", position)
    position = puppet_pos
Godot version 3.3.3
in Engine by (12 points)

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 Frequently asked questions and 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 [email protected] with your username.