Jump to content
Sign in to follow this  
EniarTenokei

RC Vehicle Cam Tracker

Recommended Posts

I want to make an RC Helicopter cam follower where I can click the hud on or off and the cam will follow the vehicle. What would the scripts, the one for the vehicle and the one for the hud, consist of?

Share this post


Link to post
Share on other sites

There are a couple of ways to go about this project depending on how you want it to work.

If you are wanting it to be completely remote controlled where you're just watching and controlling then you would have a structure similar to this

[HUD]
    -Main Controller Script
    -Cam Follower Script

[RC Helicopter]
    -Control Receiver Script

The Main Controller would handle inputs from user and then translate them accordingly to the Control Receiver
The input would be either movement controls which would be passed through llRegionSayTo() directly to the object by its UUID
The Control Receiver would listen in on a negative channel and parse data it receives and then apply the movement you wish to the object

The Cam Follower would take user camera controls (PERMISSION_CONTROL_CAMERA|PERMISSION_TRACK_CAMERA) and then on a timer() if object is around and user is still wanting the camera to follow then it would update camera position with llSetCameraParams()

Assuming you want to have it so others can watch as someone else controls the helicopter it would be similar to the above except you would most likely just move the controls all directly into [RC Helicopter] and you would just create a Cam Follower Script hud where people can select the object they want to follow by its UUID, exactly like the above scenario except its just detached from control and requires input of the UUID.

Some noteworthy comments about the code:
-Don't forget to use llClearCameraParams(); when done handling camera,
-you will most likely be using a lot of llGetCameraRot(); and llGetCameraPos();
-For the controller the Main Controller would be the one that takes permissions and inputs, the Controller Receiver will only receive listen() events from the channel specified
-If you're planning to have more than one RC in an area you will want to make sure that the llListen's are not the same for each, have them generate from a function which takes into account some sort of uniqueness

 

Share this post


Link to post
Share on other sites

The primary bummer is there is no automatic scripted camera tracking of objects or agents other than the camera owner and/or whatever they sit on.

You will have to set and clear camera params rapidly and that leaves you with a choppy mess.

There are several feature requests for giving us essentially camera control reform, things like scripted camera resetting, scripted camera focus with local pos/rot offsets, scripted entering/leaving mouselook(without the need to sit on an object), camera "rail" binding, etc.

Maybe one day, LL will invest in improving it, but I'm not holding my breath.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...