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

Out of bounds get index '1' error #1

Closed
ghost opened this issue Oct 13, 2023 · 3 comments · Fixed by #4
Closed

Out of bounds get index '1' error #1

ghost opened this issue Oct 13, 2023 · 3 comments · Fixed by #4
Assignees
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Oct 13, 2023

Hi, I think it is a good plugin that allows you to create ramps and stairs quite easily. At the moment the collisions are not being created so I can't use them entirely.

The error that I get in any ProtoRamp node that I add is this:
res://addons/proto_shape/proto_gizmo.gd:69 - Out of bounds get index '1' (on base: 'Array')

This is the code part:

# Add collision triangles by generating TriangleMesh from node mesh
gizmo.add_collision_triangles(node.get_meshes()[1].generate_triangle_mesh())
@HLCaptain HLCaptain self-assigned this Oct 13, 2023
@HLCaptain
Copy link
Owner

I could replicate the problem, but I don't think it is relatable to physics collisions. This kind of collision makes the ProtoRamp selectable with a mouse by giving the editor some shapes to guess what to select when clicking. I did not test it enough, but there is an option on CSGShape3D node to enable collisions, that might help with physics collisions.

For the time being, I am fixing the issue with line 69 (nice). I could replicate it by reparenting a ProtoRamp to another ProtoRamp.

@HLCaptain
Copy link
Owner

Indeed, confirmed, that CSGShape3D collisions are great for basic physics collisions, but I intend to expand upon that features (more variety of collision types). As I am handling child nodes loosely, I tend to delete all children on property change. I will change this, so that other children won't be affected.

@HLCaptain HLCaptain added the bug Something isn't working label Oct 13, 2023
@HLCaptain
Copy link
Owner

Decided to make the children problem another issue at #2.

@HLCaptain HLCaptain linked a pull request Oct 14, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant