Spline Blueprint not spawning all meshes

Hi, I’m making a spline tool so i can spawn random meshes from an array. It works mostly fine, but sometimes it misses some of the meshes and leaves gaps between them.

This is the main blueprint: https://blueprintue.com/blueprint/ew0z0xmt/

SetNumberOfInstances function: https://blueprintue.com/blueprint/ua-a-log/

GetLocalSpacing: https://blueprintue.com/blueprint/sa5_xdza/

GetTransformAtIndex: https://blueprintue.com/blueprint/uyexz82a/

GetRotationAtIndex: https://blueprintue.com/blueprint/0yfbi2ly/

GetLocationAtIndex: https://blueprintue.com/blueprint/zkvwwacc/

i’m sorry i know it’s a lot of functions but i’m trying to keep my code tidy :sob::sob::sob:

Any idea what could it be??

1 Like

image

Should be LASTINDEX :slight_smile:

1 Like

Omg thanks!! That fixed it :slight_smile: I don’t get the difference between these nodes though: I come from Unity and there I’d always use the array’s length for stuff like this. What’s the difference?

If the length is two, then the last index is 1. Two elements, 0 and 1. :slight_smile: