'How to Automate a Report from Namely using API
I want to automate a report I created in Namely using python, how can I do this with the Namely API?
Solution 1:[1]
One of the reasons your player might not be colliding with anything is because there is no collider on it. If you add the appropriate collider or a mesh collider, you should start having collisions. Another reason is no colliders on the things you are trying to stand on. Try adding colliders to your objects and you should be good! :)
Solution 2:[2]
Whenever physics is involved you do not want to move anything using Transform in Update. This causes unnatural movement and breaks with physics and collision detection.
If you are using the CharacterController, then actually use it and instead of Translate use CharacterController.Move
A CharacterController is not affected by forces and will only move when you call the Move function. It will then carry out the movement but be constrained by collisions.
So something like e.g.
// Reference via the Inspector
[SerializeField] private CharacterController _characterController;
private void Awake ()
{
// Or as fallback get once
if(!_characterController) _characterController = GetComponent<CharacterController>();
}
private void Update ()
{
var direction = (target - transform.position).normalized;
_characterController.Move(direction * forwardSpeed * Time.deltaTime);
SetNewTarget(transform.position + Vector3.forward * 10);
var horizontal = Input.GetAxis("Horizontal") * sidewaysSpeed * Time.deltaTime;
_characterController.Move(Vector3.right * horizontal);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ThreeJS |
| Solution 2 | derHugo |
