Skip to content

Race condition in coil activation #9

Open
@arthurkehrwald

Description

@arthurkehrwald

Problem

This script has no effect:
image
This script causes the ball to spawn:
image

Cause

What should happen is:

  1. Player.Start is called by Unity
  2. CoilPlayer.OnStart is called
  3. CoilPlayer.HandleCoilEvent is added as a callback to IGameLogicEngine.OnCoilChanged
  4. The table script starts running and the "Pulse Coil" node is executed
  5. The ball spawns

The problem is that the table script starts running before Player.Start is called and nothing happens because CoilPlayer.HandleCoilEvent does not yet observe IGameLogicEngine.OnCoilChanged. This might be non-deterministic as well because the order of in which Start is called on MonoBehaviours is. Not sure how it is in Visual Scripting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions