Announcement

Collapse
No announcement yet.

How to turn an object gradually to a mouse click around an object rather than snapping to it?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to turn an object gradually to a mouse click around an object rather than snapping to it?


    Good Afternoon all,

    I am very very new to Unreal and i am trying to learn.

    I am trying to have an object, at current just a cube, rotate to another point where i have clicked my mouse. Currently the cube snaps to face the location i have clicked, rather than gradually turning to it via a definable turn rate.

    It would be nice to have the 'cube' tip slightly as it pivots in the direction of travel like a plane, but one step at a time. My current code is below if anyone can advise?


    Click image for larger version

Name:	Turn_Script.png
Views:	4
Size:	465.8 KB
ID:	1561578










    #3
    Thanks for the pointers Nawrot.

    I've read through those and given it a go but no joy yet. Still snapping to where i click but ill keep trying.and see where i get to. Teach a man to fish and all that.

    Did find an old game that does exactly what i want to happen though as reference

    Star Trek Starfleet Command Has the same movement interface i am trying to create. Forward motion is set by a slider but rotation is done by a mouse click and the ship turns to that direction with a slight roll for effect.

    https://youtu.be/rMXCjgmPy9Q?t=387

    Comment


      #4
      Either use a timeline (more smooth, but more complex) or use the "rinterp" node with a timer (better than event tick). It allows you to rotate an actor rather smoothly.

      Or use a "vinterp" node if you want to rotate smoothly to a location. You have to try both.

      Comment


        #5
        Thanks everyone for all the guidance. I have managed to get it working with the below code. Whether it is the most robust and efficient code, I doubt it but it works.



        Attached Files

        Comment

        Working...
        X