Author Topic: Action Adventure Camera Angle  (Read 779 times)

Is it possible to make the camera stay locked behind the player even when he/she turns? The plan is to make it so the player face left and moves left if you hold A, the opposite for D, and etc. All I need is a way to get relative velocity, and a way to lock the camera into a spy location that can be rotated with the mouse.

Define relative velocity. And you can put the players camera in spy mode for the player, however, the player will not be able to move.

relative velocity i.e. the velocity in relation to a player's forward vector. So it's like setRelativeVelocity event but backwards.

relative velocity i.e. the velocity in relation to a player's forward vector. So it's like setRelativeVelocity event but backwards.
Lets say you wanted to set the forward velocity by 10
Code: [Select]
%player.setVelocity(vectorScale("10 0 0",%player.getForwardVector()));Now if you want the velocity to be backwards just scale the forward vector by -1
Code: [Select]
%player.setVelocity(vectorScale("10 0 0",vectorScale(%player.getForwardVector(),-1)));

Define relative velocity. And you can put the players camera in spy mode for the player, however, the player will not be able to move.
is there anyway to make it so the player CAN move? I don't care if it's haxory.

Code: [Select]
%player.setVelocity(vectorScale("10 0 0",%player.getForwardVector()));

I'm pretty sure you can't scale a vector by a vector; it should be
Code: [Select]
%player.setVelocity(vectorScale(%player.getForwardVector(), 10));

Oops, yeah I reversed it. No idea why I did. My bad

Oh, and assuming you're using %cl.setControlObject(%cam); ...

Code: [Select]
%cam.setControlObject(%pl);

Oh, and assuming you're using %cl.setControlObject(%cam); ...

Code: [Select]
%cam.setControlObject(%pl);
I do not follow. How do I create the camera?

Code: [Select]
%client.camera.save(path);That will give you a complete example of a camera object
Edit: I'll just do it for you
Code: [Select]
new Camera() {
   position = "-16.9317 4.0755 2.1565";
   rotation = "0 0 1 111.154";
   scale = "1 1 1";
   dataBlock = "Observer";
   canSetIFLs = "0";
      mode = "Observer";
};

what about free look, is there a way to make it so you automatically free look?