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

All joints return Node3D type when referenced in code #814

Closed
Xacorman opened this issue Mar 21, 2024 · 1 comment
Closed

All joints return Node3D type when referenced in code #814

Xacorman opened this issue Mar 21, 2024 · 1 comment
Labels
topic:runtime Concerning runtime behavior (or its source code)

Comments

@Xacorman
Copy link

Tested with all joints.

If you add a jolt joint to a scene and manually assign the nodes it works as expected but if you attempt to get a reference to it in code Godot returns an error of not being able to cast Node3D to the joint type.

Generic6DofJoint3D foo;
public override void _Ready()
{
  foo = GetNode<Generic6DofJoint3D>("bar");
}

object System.Runtime.CompilerServices.CastHelpers.ChkCastAny(System.Void*, object): System.InvalidCastException: Unable to cast object of type 'Godot.Node3D' to type 'Godot.Generic6DofJoint3D'.

Installed via Godot AssetLibrary and followed installation steps listed

@github-actions github-actions bot added the needs triage Something that needs investigation label Mar 21, 2024
@mihe mihe added topic:runtime Concerning runtime behavior (or its source code) and removed needs triage Something that needs investigation labels Mar 21, 2024
@mihe
Copy link
Contributor

mihe commented Mar 21, 2024

I'm guessing you're adding a JoltGeneric6DOFJoint to the scene? The substitute joints (JoltGeneric6DOFJoint, JoltHingeJoint3D, etc.) can't be used from C# in that way, unfortunately. See #632.

You'll need to use the regular Generic6DOFJoint instead, which uses Jolt as well.

@mihe mihe closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:runtime Concerning runtime behavior (or its source code)
Projects
None yet
Development

No branches or pull requests

2 participants