Hi there!
I'm stumped right now. I'm doing a couple of tests and I have a trigger. When I press the trigger, the camera is detached from the Pawns eyes socket and moves along a few coordinates that I pre-calculated. This works amazing, no problem there. When the small cutscene is done, the camera is re-attached to the pawn's head.
The problem is, my map is pitch dark. When you walk around with the Pawn, I have a point light attached to a Pawn's socket, so it functions as kind of an ambient light. Again, this works great. The problem is when I press the trigger and the camera changes behaviour. I've tried to spawn another ambient spot light and have it always be at the same location as the camera, but it's just not working. At all. And I have no idea why! Any help would be amazing! Here is the code:
Ambient Light Class
Pawn Class (I cut out everything that had nothing to do with the camera)
I'm stumped right now. I'm doing a couple of tests and I have a trigger. When I press the trigger, the camera is detached from the Pawns eyes socket and moves along a few coordinates that I pre-calculated. This works amazing, no problem there. When the small cutscene is done, the camera is re-attached to the pawn's head.
The problem is, my map is pitch dark. When you walk around with the Pawn, I have a point light attached to a Pawn's socket, so it functions as kind of an ambient light. Again, this works great. The problem is when I press the trigger and the camera changes behaviour. I've tried to spawn another ambient spot light and have it always be at the same location as the camera, but it's just not working. At all. And I have no idea why! Any help would be amazing! Here is the code:
Ambient Light Class
Code:
class TSAmbLight extends Actor; var PointLightComponent AmbientLight; defaultproperties { Begin Object Name=PointLightComponent0 Brightness=1 LightColor=(R=18,G=20,B=18) Radius=3500 FalloffExponent=20 LightAffectsClassification=LAC_DYNAMIC_AND_STATIC_AFFECTING CastShadows=FALSE CastStaticShadows=FALSE CastDynamicShadows=FALSE bForceDynamicLight=FALSE UseDirectLightMap=FALSE bAllowPreShadow=FALSE End Object AmbientLight=PointLightComponent0 }
Code:
class TSPawn extends SimplePawn; var TSAmbLight ambient; var TSAmbLight cutsceneAmbient; simulated function PostBeginPlay() { ambient = Spawn(class'TSAmbLight',,,Location); Mesh.AttachComponentToSocket(ambient.AmbientLight, 'AMBSocket'); } simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV ) { if (TSGame(WorldInfo.Game).bCutscene == false) { Mesh.GetSocketWorldLocationandrotation('HeadSocket', out_CamLoc); out_CamRot = GetViewRotation(); } else { out_CamLoc = desiredLocation; out_CamRot = desiredRotation; if (cutsceneAmbient != NONE) { cutsceneAmbient.SetLocation(out_Loc); } else { cutsceneAmbient = Spawn(class'TSAmbLight',,,out_CamLoc); } } return true; } defaultproperties { }
Comment