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

[Physics] PhysicsComponent Attach() ignoring existing ColliderShape #463

Closed
Eideren opened this issue Jun 2, 2019 · 0 comments
Closed

[Physics] PhysicsComponent Attach() ignoring existing ColliderShape #463

Eideren opened this issue Jun 2, 2019 · 0 comments
Labels
bug

Comments

@Eideren
Copy link
Collaborator

@Eideren Eideren commented Jun 2, 2019

Release Type: Latest

Version: Latest

Platform(s): Any

Describe the bug
Quoting sebl on Discord
"Hello,
i'm currently trying to create a physicscomponent from code. although i set a collidershape, it doesn't get added to the component. i think the reason is somewhere here
the NativeCollisionObject is null, so the collidershape doesn't get added.

so, maybe anyone has an idea of what i am missing here?
also, i get this error in the log:
'Entity xyz has a PhysicsComponent without any collider shape'"

so, maybe anyone has an idea of what i am missing here?
also, i get this error in the log:
'Entity xyz has a PhysicsComponent without any collider shape'

To Reproduce

StaticColliderComponent sc = new Xenko.Physics.StaticColliderComponent();
BoxColliderShape bcs = new Xenko.Physics.BoxColliderShape(False, SomeSize);
sc.ColliderShape = bcs;

Once the engine hits PhysicsComponent.Attach It checks for if (ColliderShapes.Count == 0) and returns immediately afterwards without checking for an existing ColliderShape.

Additional context
I'll be taking care of this issue through this PR.

@Eideren Eideren added the bug label Jun 2, 2019
@xen2 xen2 closed this in 0241b15 Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.