Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

PLS SEND HELP! Having some trouble on rotating an object

Discussion in 'Visual Scripting' started by ryaaanchuaaa, Aug 31, 2020.

  1. ryaaanchuaaa

    ryaaanchuaaa

    Joined:
    Aug 29, 2020
    Posts:
    2
    so im using this button to control a cylinder to rotate 90degrees on every click
    the problem is when i click on the button, the cylinder just jumps from 0 to 90,not showing the movements in between
    can someone tell me what im doing wrong here or what i should add to make the rotation movement visible, but not just jumping from 0 to 90?

    btw the pic i uploaded is not accurate, the yAngle is already set to 90
    and i have 0 knowledge in coding or scripting
     
  2. ryaaanchuaaa

    ryaaanchuaaa

    Joined:
    Aug 29, 2020
    Posts:
    2
  3. Siro13

    Siro13

    Joined:
    Jun 30, 2014
    Posts:
    33
    You can Lerp from 0 to 90 in some time.

    This is how I lerp Velocity from 5 (MoveSpeed) to 2 in 1sec:

    upload_2020-9-1_23-57-1.png


    I need also:

    upload_2020-9-1_23-58-28.png

    It is necessary to reset the timeElasped variable when I enter into State Walking.
    I use the State Graph, but you can adapt the nodes to the Flow Machine

    And this is where I increment the timeElasped:

    upload_2020-9-2_0-1-38.png


    I use FixedUpdate() because I use RigidBody.MovePosition but You can use normal Update()
     
  4. unity_Nx7PMLMgq9zu9Q

    unity_Nx7PMLMgq9zu9Q

    Joined:
    Mar 31, 2021
    Posts:
    5
    While key hold move by say 10 degz
     
unityunity