Scanning motion behaving unexpectedly

I’m making a security camera that scans back and forth.

When testing, I have two points below the camera on either side. The camera will scan back and forth between these points, but for some reason pitches up to 0 when returning to the first point, and back down to -14 when moving to the second point. I would’ve expected a pitch of around -14 since both points are below the camera. What’s going on here?

The problem was coming from the fact that arrays start counting at [0] but I was using [1] as my first point.

The solution is to subtract 1 from the Look at Points Length node and plug that into the > node. Then if that returns true, set the Current Look at Point to 0 instead of 1.

1 Like