- Home /
Question by
noweshed · Aug 24, 2018 at 02:48 PM ·
rotationrotatearoundpivot
How to rotate a rope like it is holding from 2 points?
[1]: /storage/temp/123307-stock-photo-family-playing-with-jump-rope-in-the-p.jpg
e.g. in the following image the boys are holding the rope and rotate it, i am very great full to get the script, i am very beginner. ,
Comment
Answer by noweshed · Aug 25, 2018 at 07:25 PM
I have got my solution myself. the rotation script is following
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class RopeRotation : MonoBehaviour {
public float Rotatespeed = 3f;
public Transform target;
private Vector3 xAxix = new Vector3 (1, 0, 0);
void Update(){
this.transform.RotateAround (target.position, xAxix, Rotatespeed);
}
} have fun!
If it's the solution you were looking for, please accept it as an answer.
Your answer
![](https://koobas.hobune.stream/wayback/20220612173422im_/https://answers.unity.com/themes/thub/images/avi.jpg)