Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhysicsProcessor ParentScene may be initialized to null #1021

Closed
manio143 opened this issue Feb 16, 2021 · 5 comments
Closed

PhysicsProcessor ParentScene may be initialized to null #1021

manio143 opened this issue Feb 16, 2021 · 5 comments
Labels
area-Physics bug Something isn't working good first issue Good for newcomers

Comments

@manio143
Copy link
Member

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.

@manio143 manio143 added the bug Something isn't working label Feb 16, 2021
@kizilsum
Copy link

kizilsum commented Aug 4, 2022

Hi! Is this still an issue? If so, I would like to take this one. @manio143 @Eideren

@Eideren
Copy link
Collaborator

Eideren commented Aug 4, 2022

@kizilsum Sure, go ahead !
Just to clarify, the help wanted message removed above is because anyone can now freely contribute to the engine. You can open PRs for any issue you want, right now the engine doesn't have a lot of traffic so you can just do so without notifying us first if you don't want to :)

@wrshield
Copy link
Contributor

Hello, I'd like to try working on this issue and was wondering if anyone had some advice or ideas on where to start. Thanks!

@Doprez
Copy link
Contributor

Doprez commented May 20, 2024

https://doc.stride3d.net/4.2/en/manual/engine/entity-component-system/index.html I assume this will be an issue within the Entity processor? I havent messed with Bullet too much but each of these physics shapes should be getting initialized in the EntityProcessor if it works like other systems.

I assume it should be around here where it gets set up.

Eideren pushed a commit that referenced this issue May 31, 2024
… to null (#2262)

* Added new assignment for parentScene in PhysicsProcessor

* Update PhysicsProcessor.cs

* Update PhysicsProcessor.cs

* Update PhysicsProcessor.cs

Moved parentScene assignment to RenderColliderShapes.

* Update PhysicsProcessor.cs

---------

Co-authored-by: dloe <dylanloe@gmail.com>
@Eideren
Copy link
Collaborator

Eideren commented May 31, 2024

Fixed through #2262

@Eideren Eideren closed this as completed May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Physics bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants