Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Resolved Is there a way to access free look camera x axis properties and set values from a script ?

Discussion in 'Cinemachine' started by SharonL75, Aug 23, 2020.

  1. SharonL75

    SharonL75

    Joined:
    Aug 13, 2020
    Posts:
    91
    I need to set the x axis speed value to 0. Is there a way to access the speed property from a script ?
     
    TheGreatrmx likes this.
  2. SharonL75

    SharonL75

    Joined:
    Aug 13, 2020
    Posts:
    91
    Solved :

    Code (csharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using Cinemachine;
    6.  
    7. public class MouseController : MonoBehaviour
    8. {
    9.     public CinemachineFreeLook camera;
    10.  
    11.     private void Start()
    12.     {
    13.         camera.m_XAxis.m_MaxSpeed = 0;
    14.     }
    15. }
    16.  
     
  3. usama_ayee

    usama_ayee

    Joined:
    Jul 24, 2021
    Posts:
    2
    Thanks a lot man! You have solved my problem. Bundles of thanks and well wishes for you.
    Regards: Muhammad UsamA