yaelatletl / godot-jigglebones

An addon that brings jigglebones to Godot Engine 4.0.
MIT License
115 stars 4 forks source link

Errors in code #2

Closed lyghtkruz closed 1 year ago

lyghtkruz commented 1 year ago

custom_node.gd - Spatial needs to be changed to Node3D

jigglebone.gd: @tool needs to be at the top of the script before extends.

@export_node_path(CollisionShape3D) var collision_shape: NodePath - should be @export_node_path("CollisionShape3D") var collision_shape: NodePath

lyghtkruz commented 1 year ago

I tried the above and the plugin loads, but I am getting an assert error. I have a correct bone name set but it is erroring about the bone name. I will look into this later. Edit: Seems like I made the mistake, head is not the same as Head :) case sensitivity will get ya.

metanoder commented 1 year ago

Tried your edits above. Plugin worked like a charm again. Thanks for sharing!

lyghtkruz commented 1 year ago

You can improve on this a bit more so that the typos like mine don't cause problems. Changing the script to inherit BoneAttachment3D instead of Node3D will already have a bone_name associated with it and it's a dropdown in the inspector.

For anyone who wants to, change the Node3D in custom_node.gd and comment out the bone name string variable in jigglebone.gd.

yaelatletl commented 1 year ago

Hi! Tried your suggestion, but the transform breaks as it's not intended to follow the bone. Otherwise, latest commits solve the errors, thank you!