What I am trying to do is a scene fly by, camera on a spline path, at the end of the spline path the camera hits the back of a character head (triggerbox), delete the character, delete the trigger box, set fixed camera to be disabled, spawn the fps preset and set that as player.
This is to be a intro to a level and goes into playing as the fps preset.
Quick question:
Is the "set camera active" tick box (in the camera properties) an action where I can use action.setActionParam(entity.getEntityIDFromTag("example camera tag"), 1, "set camera active", "0");
What I have so far:
- Code: Select all
obj = 0 -- | Define a variable for our object ID
Playerid = 0 -- define the payerid
spawnHeightOffset = 1
spawnPresetName = "FPS Kit Player A"
function onInit(objID)
sky.lprint("Head Collision script!");
obj = objID;
end
function onTrigger_Enter(hitID)
--CameraName = entity.getEntityName(hitID);
sky.lprint("Head Collision Hit= ");
--spawn the FPS player
x,y,z = entity.getPosition(obj); --Get the current position
-- Spawn the FPS Char preset.
spawnID = entity.spawnPreset(spawnPresetName , x, y + spawnHeightOffset, z );
-- get the objid from the fps player
Playerid = entity.getIDFromTag("Player");
-- Set fixed camera as none active or player in this case.
fpsSystem.setAsPlayer(entity.getIDFromTag("headtrig1"),0);
-- set FPS char preset as player
fpsSystem.setAsPlayer(Playerid,1);
--Delete the camera
entity.delete( entity.getIDFromTag("t_Camera - 2D Fixed_555304") );
-- Delete the colission box, so it can not be hit again and again.
entity.delete( entity.getIDFromTag("headtrig1") );
--delete the character model
entity.delete( entity.getIDFromTag("char1") );
end
I have tried in the code above to stop the camera been the player (if thats correct I have no idea) but want it to stop been active and the player to switch to the FPS character preset.
Thank you in advance