Timeline for Unity, Player isnt following along the waypoints
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 9, 2018 at 17:58 | vote | accept | Daniel | ||
| Jan 30, 2018 at 17:00 | comment | added | Dunk | Use: Vector3 moveDir = Vector3.Normalize(waypoints[currentWaypoint].transform.position - transform.position); rb.AddForce(DRIVING_FORCE*moveDir); Where DRIVING_FORCE can be hard-coded or calculated frame-by-frame to be more realistic. Start with hard-coding. NOTE: You'll need to do this calculation and call AddForce every frame because forces are zeroed on each update. | |
| Jan 26, 2018 at 7:07 | comment | added | Daniel | You are right, what I tried would never equal, I changed now some code but I get an error when I try moving with rb.MovePosition. I get MoveTowards takes "2" Arguments, I tried converting MoveTowards to MovePosition but seems not to work. //ADDFORCE Vector3 movePosition = transform.position; movePosition = Mathf.MoveTowards(transform.position + waypoints[currentWaypoint].transform.position * grindSpeed * Time.deltaTime); rb.MovePosition(movePosition); | |
| Jan 25, 2018 at 21:25 | history | edited | Dunk | CC BY-SA 3.0 |
added 103 characters in body
|
| Jan 25, 2018 at 21:09 | history | edited | Dunk | CC BY-SA 3.0 |
added 1 character in body
|
| Jan 25, 2018 at 20:56 | history | answered | Dunk | CC BY-SA 3.0 |