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

Part of mesh randomly disappears #6

Open
lexferreira89 opened this issue May 25, 2020 · 2 comments
Open

Part of mesh randomly disappears #6

lexferreira89 opened this issue May 25, 2020 · 2 comments

Comments

@lexferreira89
Copy link

Hi,

When playing the game or simply opening a scene with jigglebones, it's common for the part of the mesh affected by the jigglebone to disappear, causing the console to throw the following errors continuously until the game/scene is closed:

The axis Vector3 must be normalized
core/math/basis.cpp:69 - Condition "det == 0" is true

Does anyone have any idea on how to solve this?
I'm using Hasenn's fork, by the way.

@lexferreira89
Copy link
Author

According to the errors shown when playing the game, it seems the lines causing this problem are:
var bone_new_transf_obj = Transform(bone_transf_obj.basis.rotated(bone_rotate_axis_obj, bone_rotate_angle), bone_transf_obj.origin)

And maybe either this one:
var diff_vec_local = bone_transf_world.affine_inverse().xform(global_transform.origin).normalized()
Or this one:
var bone_rotate_axis = bone_forward_local.cross(diff_vec_local)

@bengtsts
Copy link

bengtsts commented Oct 4, 2021

The issue may be an invalid Vector3. Try adding:

func _process(delta):
	if is_nan(global_transform.origin[0]) or is_nan(prev_pos[0]):
		global_transform = Transform()
		prev_pos = global_transform.origin[0]

If that works, all credit to this guide!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants