Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Setting position fighting with rigidbody.moveposition

$
0
0
I'm reworking my character controller for an FPS and am trying to shoot a ray down that lifts up the player to a standing position.

Cutting out a bunch of code here's the jist of what I'm working with:

Code (CSharp):
  1. void Update()
  2. {
  3.         transform.position = standPosition;
  4. }
  5.  
  6. void FixedUpdate()
  7. {
  8.         myRigidbody.MovePosition(transform.position + playerInput * Time.fixedDeltaTime * walkSpeed);
  9. }
If you want the full code:
Code (CSharp):
  1. using System.Collections;
  2. using...

Setting position fighting with rigidbody.moveposition

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



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