Community Forum

FS19 - Move IndoorCamera

Forum Overview >> Scripting

Created11.02.2019 10:54

Kenny Je (kenny456) 11.02.2019 10:54
This work in FS17:
for i=1, self.numCameras do
if self.cameras[i].isInside then
self.internalCamera = Utils.indexToObject(self.components, self.camIndex);
x,y,z = getTranslation(self.internalCamera);
x = x + 1
setTtranslation(self.internalCamera, x,y,z)

But in FS19 camera does not move at all. How to index camera object correctly?

Bilbo Beutlin (BBeutlin) 11.02.2019 17:52
See LUADOC -> Vehicles -> VehicleCamera
You can use 'camera.cameraNode'.
I'd assume depending on camera attributes (in xml) certain 'forbidden' translations/rotations are resetted.

Kenny Je (kenny456) 17.02.2019 09:35
I tried self.spec_enterable.cameras[i].cameraNode. getTranslation of this object return right values but setTtranslation does not move the camera. I set self.spec_enterable.cameras[i].allowTranslation to true before but did not help.

Bilbo Beutlin (BBeutlin) 17.02.2019 12:31
Try moving the parent transform group instead the camera itself.

Kenny Je (kenny456) 17.02.2019 20:59
Thank you, but i also thought about that, but problem is that in parent group is some other object, which i dont want to move. So i create new transform group and linked indoorcamera to it and it works. Only problem is on vehicles that have more than one component (like ponsse scorpion) - indoorcamera moved to wrong position after linked to new group.

Andrew Swart (Unknown) 15.08.2019 09:33
Did you make any progress on this Kenny ?

I am currently trying to do something similar.

Kenny Je (kenny456) 04.11.2019 11:57
Yes, here is my complete mod:

Note: Log in to post. Create a new account here.