Skip to content

PhysicsProcessor ParentScene may be initialized to null #1021

@manio143

Description

@manio143

Release Type: GitHub

Version: master

Platform(s): N/A

Describe the bug

I'm not currently sure why or if always but on the below line the parentScene is not set, which results in later inability to display debug colliders in game.

parentScene = Services.GetSafeServiceAs<SceneSystem>()?.SceneInstance?.RootScene;

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project
  2. Add a static collider to the ground
  3. Add Debug physics shapes script
  4. Launch game and press Ctrl+Shift+P

Expected behavior
Debug collider shapes are displayed.

Additional context
The issue can be easily mitigated by adding

SceneSystem.SceneInstance.GetProcessor<PhysicsProcessor>().ParentScene = Entity.Scene;

to the beginning of the debug script.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions