playMaker

Author Topic: How to rotate like this game  (Read 851 times)

playmakertester

  • Full Member
  • ***
  • Posts: 211
How to rotate like this game
« on: July 09, 2021, 04:52:32 AM »
Hello.

I am investigating the movement of an object.

Eventually, I would like to achieve a movement like the "head" in the video.

I used Add force and Rotate to see if I could recreate it by applying force in the X-axis and Y-axis directions, and then rotating it in the X-axis direction.

Although I tried, the implemented character did not move like the one in the original video.

[Question]
Is it possible to implement the movement of the "head" in the video in the form of a circular motion? Or is it better to implement it with Add force?

If you have any advice, please let me know.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to rotate like this game
« Reply #1 on: July 09, 2021, 07:56:49 AM »
Hi.
On the video, i think the head is rotating depending on the velocity but with a minimum limit (clamp) (animation probably as a child of rigidbody)

Then force is added and when velocity goes lower or negative it will add force (or velocity) to move back to right side

playmakertester

  • Full Member
  • ***
  • Posts: 211
Re: How to rotate like this game
« Reply #2 on: July 09, 2021, 08:04:51 AM »
Thank you.

In other words

(1) Specify the movement speed in the left direction.
(2) Rotate according to the movement speed.
(3) Limit the rotation speed (maximum rotation speed A, maximum rotation speed B)
(4) Add force

Is this implementation likely to be correct?
If so, I would appreciate it if you could tell me the name of the action used in (3).

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to rotate like this game
« Reply #3 on: July 10, 2021, 07:19:14 AM »
Hi.
You could use for example a Float Clamp
or check with get velocity / float compare

playmakertester

  • Full Member
  • ***
  • Posts: 211
Re: How to rotate like this game
« Reply #4 on: July 10, 2021, 08:56:44 AM »
Ok, got it thanks!