![]() Many times when my character jumps on top of my platform, the character is pushed off of the platform on the x axis ![]() The moving platform has a RigidBody component, in case this may be the cause of this issue However, upon jumping off of the platform, the player looks sometimes like this: The scale is set to move between two invisible points, and when the player jumps on top of the platform, the player is set as a child of the platform. This works, but I feel this is not the best solution for this problem. I am unaware of the issue of this, but a temporary solution I found was to put transform.SetPositionAndRotation(transform.position, Quaternion.identity) in my Update method for my Player script. However, when I begin to move left and right, the character begins to spin via the rotation aspect on the transform component. Now, I control my character on the horizontal input. Private void OnTriggerExit(Collider other) Private void OnTriggerEnter(Collider other) If (transform.position = _targetB.position)Įlse if (transform.position = _targetA.position) Transform.position = Vector3.MoveTowards(transform.position, _targetA.position, _speed * ltaTime) Transform.position = Vector3.MoveTowards(transform.position, _targetB.position, _speed * ltaTime) Public class MovingPlatform : MonoBehaviour This is my code for the moving platform: using System ![]() Vector3 direction = new Vector3(horizontalInput, 0, 0) ![]() _uiManager = GameObject.Find("Canvas").GetComponent() ĭebug.LogError("The UI Manager is NULL!") įloat horizontalInput = Input.GetAxis("Horizontal") First, here is my code for the player: using System.Collections However, with the character controller I have had several issues with both the Character Controller and the moving platform. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |