Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

rigidbody2D.AddForce only applying after object has been dragged...

$
0
0
So I'm trying to fake a little wind effect on an object who is suppose to dangle in the air by using AddForce, it is working however the problem is that it only start to simulate it when I drag the dangeling object in the Scene view... The way I have put this up is that I have a hinge joint on my object connected with another gameobject. EDIT: Code: using UnityEngine; using System.Collections; public class wind : MonoBehaviour { public float forceMax; public float forceMin; // Use this for initialization void Start () { } // Update is called once per frame void FixedUpdate () { rigidbody2D.AddForce(new Vector2(Random.Range(forceMin, forceMax), 0)); } }

Viewing all articles
Browse latest Browse all 1264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>