stride3d / stride3d/stride

Problem eliminating entities who happend to have more than one Collider

Open
#1,695 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Official Release

Version: 4.1.0.1822

Platform(s): Windows

Describe the bug
If you try to eliminate the components of an entity, or an entity from the live scene at runtime which so happends to have two or more colliders, after you eliminate it, it will generates a bug in another part of the code, which is like the application will be trying to eliminate it a second time, even when was already eliminated.

I make a proof of concept method in this link:

https://github.com/JoseJohnen/PoC_BreakEntityRemoval

This method inside the class "Tiles" will provide an example than you can eliminate at runtime.

        public virtual void InstanceEditorReqMechanics()
        {
            try
            {
                RigidbodyComponent rComp = this.Entity.GetOrCreate<RigidbodyComponent>();
                BoxColliderShape colShape = new BoxColliderShape(false, new Stride.Core.Mathematics.Vector3(0.8f, 0.1f, 0.8f));


                rComp.RigidBodyType = RigidBodyTypes.Kinematic;


                StaticColliderComponent sComp = new StaticColliderComponent();
                sComp.CollisionGroup = Stride.Physics.CollisionFilterGroups.CustomFilter1;
                sComp.ColliderShape = colShape;


                this.Entity.Add(sComp);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error (Map_Editor_HoD.Models.TilesModels.Tile) InstanceEditorReqMechanics: " + ex.Message);
            }
        }

To Reproduce
Steps to reproduce the behavior:

Press the relevant buttons in the order of create first, and then the one to eliminate.

Screenshots
If applicable, add screenshots to help explain your problem (use GitHub drag & drop)
Picture with the issue: (To the left, the place where the code happends inside stride3d, to the right, one of the relevant piece of code in the code, using other code base)
https://cdn.discordapp.com/attachments/500285081265635330/1104200151377121351/image.png

Other Info

Some people in the discord pointed out than is possible than Stride3d is calling the components a second time for elimination after eliminate them, being by the scene.remove, being by the btnDelete;

Thank you for your time

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked PoC_BreakEntityRemoval project and reproduce the issue by creating an entity with multiple colliders, then removing it at runtime. Trace whether scene removal and the delete button both trigger component elimination. Done means removing the entity produces no second-elimination error or related failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.