Hey everyone, I’m working on a project with UDK and I need a way to read the camera position and rotation from Kismet. I don’t have much UnrealScript experience, but after some tinkering I came up with this node:
/**
* This kismet node is used to pass the current camera location and rotation to Kismet
*/
class SeqAct_CameraLocation extends SequenceAction;
function Activated()
{
local PCont PC;
local vector CameraLoc;
local rotator CameraRot;
PC = PContPC(GetWorldInfo().GetALocalPlayerController());
PC.GetPlayerViewPoint(CameraLoc, CameraRot);
}
defaultproperties
{
ObjName="Camera Location"
ObjCategory="Camera"
VariableLinks.Empty
VariableLinks(0)=(ExpectedType=class'SeqVar_Vector',bWriteable = true, LinkDesc="Location",PropertyName=CameraLoc)
VariableLinks(1)=(ExpectedType=class'SeqVar_Vector',bWriteable = true, LinkDesc="Rotation",PropertyName=CameraRot)
}
The node compiles correctly, but it doesn’t seem to be working. I feel I’m doing something wrong either when I call the GetPlayerViewPoint function or I’m not outputting the variables correctly. Can anyone help me? If there’s an easier way to output the game camera location and rotation to Kismet that’s also welcome.