I’m really lost on this one.
I’m using the rendercam library, but for some reason I just can’t seem to refer to any camera. Every time I try to call this function,
rendercam.activate(cam_id)
I always get the warning that the camera wasn’t found. However, trying to fix this, I snuck some print()s in the activate_camera function, and as it turns out, the cam_id being used there is perfectly fine.
print(cam_id):
hash: [/level_cam]
pprint(cameras):
{
hash: [/level_cam] = { --[[0000029D92F574E0]]
active = true,
following = false,
id = hash: [/level_cam],
aspectRatio = 1.7777777777778,
worldZ = 0,
useViewArea = false,
nearZ = -1,
lpos = vmath.vector3(0, 0, 0),
wupVec = vmath.vector3(0, 1, 0),
halfViewArea = vmath.vector3(0, 0, 0),
lforwardVec = vmath.vector3(0, 0, -1),
orthoScale = 1,
fov = -1,
viewArea = vmath.vector3(0, 0, 0),
follows = { } --[[0000029D92F57690]],
recoils = { } --[[0000029D92F57640]],
shakes = { } --[[0000029D92F575F0]],
lrightVec = vmath.vector3(1, 0, 0),
abs_nearZ = -1,
scaleMode = hash: [fixedArea],
wforwardVec = vmath.vector3(0, 0, -1),
wpos = vmath.vector3(0, 0, 0),
orthographic = true,
abs_farZ = 1,
farZ = 1,
fixedAspectRatio = false,
lupVec = vmath.vector3(0, 1, 0)
}
}
print(cameras(cam_id)) however is just nil. But I doubt that it’s the rendercam script’s fault, so here’s also how I call the function:
local camID = go.get_id("/level_cam")
rendercam.activate_camera(camID)
And here’s how they are arranged in the collection (the above is being used in a script inside player.go), the collection is loaded as a proxy into the main collection.
I know that proxies are often troublemakers when it comes to addressing game objects, but I doubt that that’s the problem here. Anyway, as I said, I have no clue why this isn’t working, but I’m probably just missing something.
Does anyone know what’s happening here?