Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Error message with code? C#

$
0
0
**I keep getting an error with my code: error CS1501: No overload for method `Attract' takes `0' arguments Here is my code:** using UnityEngine; using System.Collections; public class PlanetGravityEnter : MonoBehaviour { public float gravity = -10f; public void OnTriggerStay (Collider player) { Attract (); } public void Attract(Transform body) { Vector3 targetDir = (body.position - transform.position).normalized; Vector3 bodyUp = body.up; body.rotation = Quaternion.FromToRotation (bodyUp, targetDir) * body.rotation; body.rigidbody.AddForce (targetDir * gravity); } } **Thank you**

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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