unity set position
// To set the position of a gameobject use the following
GameObject.transform.position = new Vector3(x, y, z);
unity set position
// To set the position of a gameobject use the following
GameObject.transform.position = new Vector3(x, y, z);
how to move player with transform. position
public class bbo2 : MonoBehaviour
{
private const float _minimumHeldDuration = 0.25f;
private float _holdPressedTime = 0.5f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetButton("m"))
{
if (Time.timeSinceLevelLoad - _holdPressedTime > _minimumHeldDuration)
{
transform.position += new Vector3(10f, 0, 0) * Time.deltaTime;
}
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us