Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Rigidbody2D Move Position Not Working

$
0
0
I am trying to create a script that when the mouse is pressed moves a rigidbody. I have consulted the unity documentation on Rigidbody2D.MovePostion and I am still getting an error. I am wondering what I'm doing wrong and how I can fix it. If anyone has any help that would be greatly appreciated. Thanks in advance. Here is what I have for code: var Velocity : Vector2; var Object : Rigidbody2D ; function Start () { Object = GetComponent.(); } function Update () { if (Input.GetMouseButton(0)) { Frame.MovePosition(RearWheel.position + Velocity * Time.fixedDeltaTime); } }

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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