Jump to content
RAGE Multiplayer Community

Move created camera with mouse

Recommended Posts

I have created a camera to spectate players and I would like to add that you can move the camera around with your mouse as you normally would.
This is my code so far:


int camera;

public void StartSpectate(object[] args)
            Player target = Entities.Players.All.First(p => p.RemoteId == (ushort)Convert.ToUInt32(args[0]));

            camera = RAGE.Game.Cam.CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", target.Position.X, target.Position.Y, target.Position.Z, 0f, 0f, 0f, 40f, false, 0);
            RAGE.Game.Cam.SetCamActive(camera, true);
            RAGE.Game.Cam.RenderScriptCams(true, false, 0, false, true, 0);
            RAGE.Game.Cam.AttachCamToEntity(camera, target.Handle, 0f, -7.5f, 2.5f, true);
            RAGE.Game.Cam.PointCamAtEntity(camera, target.Handle, 0f, 0f, 0f, true);
            RAGE.Game.Entity.AttachEntityToEntity(Player.LocalPlayer.Handle, target.Handle, 0, 0f, 0f, 5f, 0f, 0f, 0f, true, false, false, false, 0, false);

Any ideas?

Link to post
Share on other sites
  • 2 months later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...