Jump to content
Sign in to follow this  
Mr Sarkey

Camera following a vehicle

Recommended Posts

Well I had a look around, found a lot of OFP scripts that do not work in ArmA and still fail to find something that does work/ I can work. All I need is something that allows me to put the camera where I want it, but to be fixed to the vehicle. So it wouldn't help if it was locked to to the centre of vehicle.

Anything ? sad_o.gif

Share this post


Link to post
Share on other sites

In what way?

1. Attached to a vehicle... but with some 'inertia' avoid seeing how the camera is jumping when the vehicle is jumping too...

2. 100% fixed in a fixed position... just like 'glued' or 'soldered'.

In what way?

Share this post


Link to post
Share on other sites

So the camera is locked to the vehicle, so it follows it, but then so you can posistion the camera so it is facing any part of the vehicle. This would mean that it is not orientated around the centre of the object.

Share this post


Link to post
Share on other sites

But... maybe... at the same time you need a fixed origin of coordinates as a reference to your 'algorithm' of -moving-camera... i think... maybe...

http://community.bistudio.com/wiki/boundingBox

and as always, getPos,setPos,modeltoworld family, distance...

If you have the center of the vehicle as the reference... you can add/remove some value from the original to 'move' the camera where you wanting, but always reasonably 'near' the vehicle...

? ? ?

Share this post


Link to post
Share on other sites

This will look at the vehicle from the right hand side.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Vehicle=_This Select 0;

_Camera="camera" Createvehicle [0,0,0];

_Camera camsettarget _Vehicle;

_Camera SwitchCamera "External";

WaitUntil

{

_Camera CamSetRelPos [5,0,0];

_Camera SetDir ((GetDir _Vehicle)-90);

_Camera CamCommit 0;

!(Alive (_Vehicle))

};

This will look at the vehicle from the left hand side.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Vehicle=_This Select 0;

_Camera="camera" Createvehicle [0,0,0];

_Camera camsettarget _Vehicle;

_Camera SwitchCamera "External";

WaitUntil

{

_Camera CamSetRelPos [-5,0,0];

_Camera SetDir ((GetDir _Vehicle)+90);

_Camera CamCommit 0;

!(Alive (_Vehicle))

};

camSetTarget does not look like it's working the way it used to in OFP? So you have to compensate with setDir, it's not as flexible but at least it works. It might be a bug, but don't hold your breath if it is.

Quote[/b] ]So it wouldn't help if it was locked to to the centre of vehicle.

If you want it to point in another direction, you have to change the value for setDir.

Share this post


Link to post
Share on other sites

I might be doing something wrong but I cant get that to work.

Share this post


Link to post
Share on other sites

Maybe I should ask how to use the script's posted above ?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×