private void EndCinematic() { FreeLookCam cam = _player.GetComponent <Link>().cameraRig.GetComponent <FreeLookCam>(); cam.ResetCamera(); _fuelMeter.SetActive(true); minimap.SetActive(true); RenderSettings.fog = true; mainCamera.parent.rotation = Quaternion.Euler(Vector3.zero); mainCamera.rotation = mainCamera.parent.rotation; mainCamera.position = mainCamera.parent.position + (Vector3.up * 2); Destroy(_title.gameObject); WATCHED = true; ShowMessage.GetInstance.PlayMessage( "Find the four Shrines on this plateau and acquire the containing Runes to venture beyond.", 15); _player.GetComponent <Link>().ReplaceStartPosition = _newStartPosition; _player.GetComponent <LocationText>().ShowPlateauName(); Tutorial.GetInstance.Resume(); Destroy(gameObject); }
// Use this for initialization void Awake() { isMine = photonView.isMine; view = photonView; if (isMine) { // Set in the Editor. // Ce sera la seule dans le scene. On affiche pas ceux des autres joueurs. cam = GameObject.FindGameObjectWithTag("PlayerCamera"); camscript = cam.GetComponent <FreeLookCam>(); camscript.m_Target = gameObject.transform; BuildConfirm = false; AvailableTurrets = new List <string>(); AvailableTurrets.Add("Cannon"); AvailableTurrets.Add("Hammer"); AvailableTurrets.Add("Crossbow"); tourelle = (GameObject)Resources.Load(AvailableTurrets[curretTurret]); pretourelle = (GameObject)Resources.Load(AvailableTurrets[curretTurret] + "Preview"); } else { txtname.text = photonView.owner.NickName; } }
void Start() { animator = GetComponent <Animator>(); prevMouseX = Input.GetAxis("Mouse X"); speedMultiplier = 1f; wallClip = Camera.main.transform.parent.parent.GetComponent <ProtectCameraFromWallClip>(); lookCam = Camera.main.transform.parent.parent.GetComponent <FreeLookCam>(); targetInfoCanvas = TargetInfo.GetComponent <CanvasGroup>(); playerSkills = PlayerSkills.Current; DisableTargetInfo(); TalkIndicator.SetActive(false); EnableHud(); DisableConversationUI(); IsNotBusy = true; playerCharController = GetComponent <CharacterController>(); AttackAudio.volume = 0; }
override public void OnStartLocalPlayer() { source = GetComponent <AudioSource>(); source.PlayOneShot(soundMusicGame, volSoundMusicGame); base.OnStartLocalPlayer(); GameObject camController = GameObject.FindGameObjectWithTag("CamController"); FreeLookCam flc = camController.GetComponent <FreeLookCam>(); flc.Target = gameObject.transform; flc.gameStart(); GameObject canvas = GameObject.FindGameObjectWithTag("Canvas"); canvas.GetComponent <ShowHPMana>().Player = this; cam = Camera.main; dead = false; playedDead = false; gate = GameObject.Find("GateToTheHell").GetComponent <GateToTheHell>(); networkManager = GameObject.Find("NetworkManager").GetComponent <NetworkManager>(); if (networkManager == null) { networkManager = GameObject.Find("LobbyManager").GetComponent <NetworkManager>(); } gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); animationWinStarted = false; }
void Start() { shotsRemainingInBurst = burstCount; cam = GameObject.FindObjectOfType <FreeLookCam>(); muzzleflash = GetComponent <MuzzleFlash>(); audioSource = GetComponent <AudioSource>(); }
private void OnEnable() { if (m_FreeLookCam == null) { m_FreeLookCam = FreeLookCam.instance; } m_Slider.value = m_FreeLookCam.TurnSpeed; }
// Use this for initialization void Awake() { _Cam = Camera.main.transform; _rb = GetComponent <Rigidbody> (); _anim = GetComponent <Animator> (); _FreeCam = GameObject.FindObjectOfType <FreeLookCam> (); }
private Vector3Int playerPos = new Vector3Int(1, 2, 2); // xy is Front and Back, yz is Left and Right private void Start() { _cam = FindObjectOfType <FreeLookCam>(); UpdatePlayerPos(); GoToNextState(); // to front _mouseHint = FindObjectOfType <MouseHint>(); Invoke("CheckIfClickPromptNecessary", 2f); }
void Awake() { freeLookCam = GetComponent <FreeLookCam>(); cameraCollision = GetComponent <CameraCollision>(); cameraShake = GetComponent <CameraShake>(); bossCam = GetComponent <BossCam>(); }
void Start() { //StartBossFight(); animator = GetComponent <Animator>(); freeLookCam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <FreeLookCam>(); bossCam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <BossCam>(); plasmaRayGO = transform.Find("Root/L_Mortars/PlasmaRay").gameObject; armAttackGO = transform.Find("Root/L_Clavicle/L_Biceps/L_Forearm/L_Hand/ArmAttack").gameObject; turretsManager = GameObject.FindGameObjectWithTag("TurretManager").GetComponent <TurretsManager>(); bodyMaterial = bodyGO.GetComponent <SkinnedMeshRenderer>().material; }
private void Start() { home = GetComponentInParent <PlayerControl>(); tpscam = home.camscript; home.fpscam = gameObject; gameObject.SetActive(false); guistyle = new GUIStyle(); guistyle.fontSize = sizeviseur; guistyle.normal.textColor = Color.white; }
private void Awake() { // Get game objects ball = transform.Find("RollerBall").gameObject; bob = transform.Find("ThirdPersonController").gameObject; // Get camera and its attached script camObject = transform.Find("Camera/FreeLookCameraRig").gameObject; camScript = camObject.GetComponent <FreeLookCam> (); location = new Vector3(0, 0, 0); getInitialForm(currentForm); }
protected override void Awake() { base.Awake(); Cursor.lockState = m_LockCursor ? CursorLockMode.Locked : CursorLockMode.None; Cursor.visible = !m_LockCursor; m_PivotEulers = m_Pivot.rotation.eulerAngles; m_PivotTargetRot = m_Pivot.transform.localRotation; m_TransformTargetRot = transform.localRotation; instance = this; }
void Awake() { _securityCameraController = GetComponent <SecurityCameraController>(); _actionController = GetComponentInChildren <ActionController>(); _freeLookCam = GetComponentInChildren <FreeLookCam>(); _interactiveObject = GetComponent <InteractiveObject>(); _audioController = GetComponent <AudioController>(); _camera = GetComponentInChildren <Camera>(); _postProcessingBehaviour = GetComponentInChildren <PostProcessingBehaviour>(); _audioListener = GetComponentInChildren <AudioListener>(); ReleaseControl(); }
// Use this for initialization void Start() { timeText.GetComponent <Animator>().SetBool("FadeIn", true); Vector3 spawnPoint = new Vector3(Random.Range(-60, -40), 10, Random.Range(-60, -40)); localPlayer = PhotonNetwork.Instantiate("Player", spawnPoint, Quaternion.Euler(0, 0, 0), 0); localCam = PhotonNetwork.Instantiate("Cameras", spawnPoint, Quaternion.Euler(0, 0, 0), 0); freeLookCam = localCam.GetComponentInChildren <FreeLookCam>(); thirdPersonUserControl = localPlayer.GetComponent <ThirdPersonUserControl>(); canvas.worldCamera = localCam.GetComponent <cameraPV>().cam; canvas.planeDistance = 0.1f; bmc.NoteUpdate(); //localPlayer.GetComponent<JobManager>().SetPlayerJob(); FindObjectOfType <ForceCameraRatio>().Start(); }
public void CreateCameraToPlayer() { var cameraInstantiate = Instantiate(Cameras, transform.position, Quaternion.identity); FreeLookCam freeLookCam = cameraInstantiate.transform.Find("FreeLookCameraRig").GetComponent <FreeLookCam>(); GetComponent <PlayerController>().SetCurrentCameraTranform(freeLookCam.GetComponent <Transform>()); freeLookCam.SetTarget(this.gameObject.transform); Transform ThirdCameraObj = GameObject.FindWithTag("ThirdCamera").GetComponent <Transform>(); GameObject objectgoot; objectgoot = ThirdCameraObj.gameObject; CameraControllerPlayer.SetThirdCamera(objectgoot); }
public void Awake() { Camera = GameObject.FindObjectOfType <FreeLookCam> (); // in case we started this demo with the wrong scene being active, simply load the menu scene if (!PhotonNetwork.connected) { SceneManager.LoadScene(WorkerMenu.SceneNameMenu); return; } Vector3 position = new Vector3(1000, 50, 300); // we're in a room. spawn a character for the local player. it gets synced by using PhotonNetwork.Instantiate GameObject newPlayerObject = PhotonNetwork.Instantiate("UMARPG", position, Quaternion.identity, 0); Camera.SetTarget(newPlayerObject.transform); }
protected override void Awake() { Instance = this; base.Awake(); // Lock or unlock the cursor. /* * Cursor.lockState = m_LockCursor ? CursorLockMode.Locked : CursorLockMode.None; * Cursor.visible = !m_LockCursor;*/ m_PivotEulers = m_Pivot.rotation.eulerAngles; m_PivotTargetRot = m_Pivot.transform.localRotation; m_TransformTargetRot = transform.localRotation; SetCameraDistance(Distance); }
void Awake() { if (_instance == null) { _instance = GetComponent <CameraCtrl>(); } else if (_instance != GetComponent <CameraCtrl>()) { Debug.LogWarningFormat("There is more than one {0} in the scene,auto inactive the copy one.", typeof(CameraCtrl).ToString()); gameObject.SetActive(false); return; } mainCamera = Camera.main; if (mainCamera) { shakeComponent = mainCamera.GetComponent <ShakeObject>(); rootNodeCamera = mainCamera.GetComponentInParent <FreeLookCam>(); } }
// Use this for initialization void Start() { Julia = GameObject.Find("Julia").GetComponent <Astral>(); prisonerCamera = GameObject.Find("Prisoner Camera Rig").GetComponent <FreeLookCam>(); prisonerCamera.GetComponent <FreeLookCam>().enabled = true; prisonerCamera.GetComponent <ProtectCameraFromWallClip>().enabled = false; prisonerInventory = new List <Prisoner>(); canSwap = true; //we are starting in a prisoner if (startingPosPrisoner != null) { StartCoroutine(possesionStart(true)); //we are staring in Julia } else { StartCoroutine(possesionStart(false)); } }
private void HandleRotation(FreeLookCam cam, float x, float y) { if (Time.timeScale < float.Epsilon) { return; } // Adjust the look angle by an amount proportional to the turn speed and horizontal input. cam.m_LookAngle += x * cam.m_TurnSpeed; // Rotate the rig (the root object) around Y axis only: cam.m_TransformTargetRot = Quaternion.Euler(0f, cam.m_LookAngle, 0f); if (cam.m_VerticalAutoReturn) { // For tilt input, we need to behave differently depending on whether we're using mouse or touch input: // on mobile, vertical input is directly mapped to tilt value, so it springs back automatically when the look input is released // we have to test whether above or below zero because we want to auto-return to zero even if min and max are not symmetrical. cam.m_TiltAngle = y > 0 ? Mathf.Lerp(0, -cam.m_TiltMin, y) : Mathf.Lerp(0, cam.m_TiltMax, -y); } else { // on platforms with a mouse, we adjust the current angle based on Y mouse input and turn speed cam.m_TiltAngle -= y * cam.m_TurnSpeed; // and make sure the new value is within the tilt range cam.m_TiltAngle = Mathf.Clamp(cam.m_TiltAngle, -cam.m_TiltMin, cam.m_TiltMax); } // Tilt input around X is applied to the pivot (the child of this object) cam.m_PivotTargetRot = Quaternion.Euler(cam.m_TiltAngle, cam.m_PivotEulers.y, cam.m_PivotEulers.z); if (cam.m_TurnSmoothing > 0) { cam.m_Pivot.localRotation = Quaternion.Slerp(cam.m_Pivot.localRotation, cam.m_PivotTargetRot, cam.m_TurnSmoothing * Time.deltaTime); cam.transform.localRotation = Quaternion.Slerp(cam.transform.localRotation, cam.m_TransformTargetRot, cam.m_TurnSmoothing * Time.deltaTime); } else { cam.m_Pivot.localRotation = cam.m_PivotTargetRot; cam.transform.localRotation = cam.m_TransformTargetRot; } }
private bool m_Jump; // the world-relative desired move direction, calculated from the camForward and user input. void Start() { mCamera = GameObject.Find("FreeLookCameraRig").GetComponent <FreeLookCam>(); mCamera.SetTarget(transform); // get the transform of the main camera if (Camera.main != null) { m_Cam = Camera.main.transform; } else { Debug.LogWarning( "Warning: no main camera found. Third person character needs a Camera tagged \"MainCamera\", for camera-relative controls."); // we use self-relative controls in this case, which probably isn't what the user wants, but hey, we warned them! } // get the third person character ( this should never be null due to require component ) m_Character = GetComponent <ThirdPersonCharacter>(); }
private void OnEnable() { StartCoroutine(Logo()); PhotonNetwork.isMessageQueueRunning = true; pv = GetComponent <PhotonView>(); easyTween = GetComponent <EasyTween>(); readyManager = FindObjectOfType <ReadyManager>(); dayNightController = GetComponent <DayNightController>(); localCam = readyManager.localCam; localPlayer = readyManager.localPlayer; localPlayer.GetComponent <JobManager>().enabled = true; thirdPersonUserControl = readyManager.thirdPersonUserControl; freeLookCam = readyManager.freeLookCam; if (PhotonNetwork.player.IsMasterClient) { SetPlayerJob(); } }
public static void SetCameraTarget(BoltEntity Entity) { FreeLookCam lookCam = GameObject.Find("FreeLookCameraRig").GetComponent <FreeLookCam>(); lookCam.SetTarget(Entity.gameObject.transform); }
public void Init() { GameObject SA = GameObject.Find("SA_INT"); GameObject go = UtilFunction.ResourceLoad("Prefabs/WSM/Level10GameObjectManager"); playerGO = GameObject.Find("ThirdPersonController"); player_Script = playerGO.GetComponent <ThirdPersonCharacter_WSM>(); FreeLookCameraRig = GameObject.Find("FreeLookCameraRig").transform; m_FreeLookCam = FreeLookCameraRig.GetComponent <FreeLookCam>(); m_ProtectCameraFromWallClip = FreeLookCameraRig.GetComponent <ProtectCameraFromWallClip>(); texie = FreeLookCameraRig.Find("Pivot/Main Camera").GetComponent <AClose_Up>();// 相机上的特写脚本 m_GanCha = FreeLookCameraRig.Find("Pivot/Main Camera").GetComponent <GuanCha_WSM>(); TV = SA.transform.Find("Ex_5C_F10/TV").gameObject; TV_Animator = TV.GetComponent <Animator>(); ZhiYaoTaiDaWuTi = go.transform.Find("L5_Intrument_F_Boy").gameObject; InputField_2 = SA.transform.Find("Ex_5C_F10/TV/dianshiji_Da/dianshiji_3/Vault_Screen_Canvas/InputField").gameObject; JieMi = InputField_2.GetComponent <Level_10_MakeRiddle>(); ZhiYaoTai = go.transform.Find("L5_Intrument_F").gameObject; ZhiYaoTaiScript = ZhiYaoTai.GetComponent <L5_Intrument_F_Manager>(); ZhiYaoTaiCamera = go.transform.Find("ZhiYaoTaiCamera").GetComponent <Camera>(); ZhiYaoTaiCamera.gameObject.SetActive(false); GuiZi = SA.transform.Find("Ex_5C_F10/fj_all/L_Desk_T").gameObject; Door_1 = SA.transform.Find("SA_Exterior_5/EX_5A_Indoor/EX_5B_Indoor_10F/EX_5B_10F_Door/EX_5B_10F_Door_1").gameObject; Door_2 = SA.transform.Find("SA_Exterior_5/EX_5A_Indoor/EX_5B_Indoor_10F/EX_5B_10F_Door/EX_5B_10F_Door_2").gameObject; Door_2_Script = Door_2.GetComponent <Gate_WSM>(); lookTransform = go.transform.Find("LookTransform"); playerPositions = new Transform[go.transform.Find("playerPositions").childCount]; for (int i = 0; i < playerPositions.Length; i++) { playerPositions[i] = go.transform.Find("playerPositions").GetChild(i); } TaskPosition = new Transform[go.transform.Find("Task").childCount]; for (int i = 0; i < TaskPosition.Length; i++) { TaskPosition[i] = go.transform.Find("Task").GetChild(i); } MiTiXiangJI = go.transform.Find("LookTransform/Camera").gameObject; MiTiXiangJI.SetActive(false); JianShiQi = SA.transform.Find("Ex_5C_F10/TV/dianshiji_Da/F10_dianshiji_videofeed").gameObject; Show_dianshiji_videofeed(false); //飞虫路点 waypoints_0 = new Transform[go.transform.Find("CRIPositions").childCount]; for (int i = 0; i < waypoints_0.Length; i++) { waypoints_0[i] = go.transform.Find("CRIPositions").GetChild(i); } waypoints_1 = new Transform[go.transform.Find("CRIPositions (1)").childCount]; for (int i = 0; i < waypoints_1.Length; i++) { waypoints_1[i] = go.transform.Find("CRIPositions (1)").GetChild(i); } waypoints_2 = new Transform[go.transform.Find("CRIPositions (2)").childCount]; for (int i = 0; i < waypoints_2.Length; i++) { waypoints_2[i] = go.transform.Find("CRIPositions (2)").GetChild(i); } m_cri = gameObject.AddComponent <CRI_Manaager>(); m_cri.Init(); MelissaPosition = new Transform[go.transform.Find("MelissaPosition").childCount]; for (int i = 0; i < MelissaPosition.Length; i++) { MelissaPosition[i] = go.transform.Find("MelissaPosition").GetChild(i); } }
public void CreateRole(int roleId) { // 添加角色相关数据 //mRoleObject = ObjectManager.mRole; Vector3 pos = Vector3.zero; if (mRoleObject != null) { pos = mRoleObject.mPosition; ObjectManager.DestroyObject(mRoleObject); } if (mRoleObject == null) { mRoleObject = new CRoleObject(); } ObjectManager.mRole = mRoleObject; ObjectManager.mRole.mObjId = roleId; // 加载主角资源 mRoleGo = ResourceManager.Instance.GetRolePrefab(roleId + "_Tpose"); if (mRoleGo == null) { return; } mRoleGo.name = roleId.ToString(); if (pos.Equals(Vector3.zero)) { mRoleObject.mPosition = new Vector3(-95f, 4.78f, -84f); } mRoleGo.transform.localPosition = mRoleObject.mPosition; mRoleGo.transform.localScale = new Vector3(1.2f, 1.2f, 1.2f); mRoleObject.mObjModel = roleId; mRoleObject.mGameObject = mRoleGo; mRoleObject.mTransform = mRoleGo.transform; // 创建主相机 //mMainCamera = GameObject.Find("Main Camera"); //if (mMainCamera == null) //{ // mMainCamera = new GameObject("Main Camera"); // Camera camera = mMainCamera.AddComponent<Camera>(); //} // 相机跟随 //mCameraMove = mMainCamera.GetComponent<CameraMove>(); //if (mCameraMove == null) //{ // mCameraMove = mMainCamera.AddComponent<CameraMove>(); //} //mCameraMove.SetRoleGameObject(mRoleGo.transform.Find("Bip01").gameObject); _mFreeCam = GameObject.Find("FreeLookCameraRig").GetComponent <FreeLookCam>(); _mFreeCam.SetTarget(mRoleObject.mTransform); // 添加角色移动控制器 PlayerCtrlManager mPlayerCtrlManager = mRoleGo.GetComponent <PlayerCtrlManager>(); if (mPlayerCtrlManager == null) { mPlayerCtrlManager = mRoleGo.AddComponent <PlayerCtrlManager>(); } if (mRoleObject.mGameObject.GetComponent <AudioListener>() == null) { mRoleObject.mGameObject.AddComponent <AudioListener>(); } UIManager.Instance.OpenUI("UHUDUI"); UIManager.Instance.mHUDUIPanel = GameObject.Find("UHUDUI").GetComponent <UHUDUI>(); // 添加角色逻辑组件 mRoleObject.AddComponent <FindingPathComponent>(); mRoleObject.AddComponent <AnimatorComponent>(); mRoleObject.AddComponent <SkillComponent>(); mRoleObject.AddComponent <ViewComponent>(); mRoleObject.AddComponent <MoveComponent>(); mRoleObject.AddComponent <RestoreComponent>(); mRoleObject.AddComponent <InjuredComponent>(); mRoleObject.AddComponent <EffectComponent>(); }
void Start() { m_Slider.maxValue = 10; m_FreeLookCam = FreeLookCam.instance; }
private void Start() { instance = this; }
private bool PoSui_DiMian = false; //地面 #endregion #region ---------调用方法---------- public void Init() { GameObject go2 = GameObject.Find("SA_INT"); GameObject go = UtilFunction.ResourceLoad("Prefabs/WSM/Level05GameObjectManager"); playerGO = GameObject.Find("ThirdPersonController"); //TODO FreeLookCameraRig = GameObject.Find("FreeLookCameraRig").transform; m_FreeLookCam = FreeLookCameraRig.GetComponent <FreeLookCam>(); m_ProtectCameraFromWallClip = FreeLookCameraRig.GetComponent <ProtectCameraFromWallClip>(); PlayerPositions = new Transform[go.transform.Find("PlayerPosition").childCount]; for (int i = 0; i < PlayerPositions.Length; i++) { PlayerPositions[i] = go.transform.Find("PlayerPosition").GetChild(i); } TaskPosition = new Transform[go.transform.Find("Task").childCount]; for (int i = 0; i < TaskPosition.Length; i++) { TaskPosition[i] = go.transform.Find("Task").GetChild(i); } //楼梯 LouTi_5_1_PoSui = go2.transform.Find("SA_Exterior_5/EX_5A_Indoor/EX_5B_Indoor_4F/EX_5B_4F_Stairs/EX_5A_4F_Stairs_B/F4_Stairs_Collision").gameObject; LouTi_5_1_PoSuiAnimator = LouTi_5_1_PoSui.GetComponent <Animator>(); LouTi_5_1_Collider = go2.transform.Find("WALL_Collider/4F/Stairs/PoSuiTiZi").gameObject; LouTi_5_1_Model = GameObject.Find("LoTi_5_1"); //LouTi_5_1_Collider = go.transform.Find("LouTi_5_1_Collider").gameObject; DiBan_F5_4PlSun = go2.transform.Find("SA_Exterior_5/EX_5A_Indoor/EX_5B_Indoor_5F/EX_5B_5F_Floor/F5_Floor_Collision").gameObject; DiBan_F5_4Animator = DiBan_F5_4PlSun.GetComponent <Animator>(); //地板 //DiBan_F5_4_Model = GameObject.Find("EX_5B_5F_Floor1"); DiBan_F5_4_Collider = go.transform.Find("LouTi_5_1_Collider").gameObject; TiZi_F5_25_Model = GameObject.Find("LouTi_1"); TiZi_F5_25_Collider_Ground = GameObject.Find("F5_25_Ground"); TiZi_F5_25_Collider_Wall = GameObject.Find("F5_25_Wall"); Radio_GameObject = go.transform.Find("Radio").gameObject; Radio_Script = Radio_GameObject.GetComponent <Level5_Radio>(); Radio_Script.Init(); F5_16Zomeber = go.transform.Find("Enemy/F5_16_Zomber").gameObject; F5_16ZomeberScript = F5_16Zomeber.GetComponent <Zomber_F5_16>(); F5_16ZomeberScript.Init(); F5_6_Zomber = go.transform.Find("Enemy/F5_06_Zomber").gameObject; F5_6_Zomber_Script = F5_6_Zomber.GetComponent <Zomber_5F_6>(); F5_13_Zomber = go.transform.Find("Enemy/F5_13_Zomber").gameObject; F5_13_Zomber_Script = F5_13_Zomber.GetComponent <Zomber_5F_6>(); LianTiao = go.transform.Find("WanZhengSuoLian").gameObject; JuanLianMen = GameObject.Find("EX_5B_5F_Curtain_2"); X_Window = GameObject.Find("EX_5B_5F_Window_2"); X_WindowScript = X_Window.GetComponent <OpenDoor_WSM>(); JayceeMonster_TiZi = go.transform.Find("Enemy/JayceeBoss_2").gameObject; JayceeMonster_TiZi_Script = JayceeMonster_TiZi.GetComponent <Level_05_JayceeBoss_2>(); JayceeMonster_TiZi.SetActive(false); F5_21_Hint = GameObject.Find("F5_21_Hint"); Show_F5_21_Hint(false); CanLevel5 = true; }
// Use this for initialization void Start() { lookScript = GetComponent <FreeLookCam> (); lookScript.SetTurnSpeed(0); Invoke("EnableTurn", 5f); }
void OnPlayerSpawn(GameObject player){ cameraPositionOffset_current = camera_PositionOffset_normal; Vector3 angles = transform.eulerAngles; owner = player.GetComponent<GTA_Controller>(); owner.c = gameObject.GetComponent<GTA_CameraOrbit>(); powner = gameObject.GetComponent<ProtectCameraFromWallClip>(); powner.p = gameObject.GetComponent<GTA_CameraOrbit>(); ipowner = gameObject.GetComponent<FreeLookCam>(); ipowner.z = owner; }