- Home /
Question by
Trild123787898 · Mar 20, 2019 at 12:26 AM ·
rigidbodytransformscript.object
problem with rigidbody.position
This script is hanging on the object, and when I press the button, the object disappears!
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour
{
public Transfom position;
void Update()
{
if(Input.GetKey(KeyCode.E))
{
GetComponent<Rigidbody>().position = Vector3.zero;
}
}
}
Comment
Answer by Ahmed_25 · Mar 20, 2019 at 07:20 AM
The object wasn't disappear but it goes to position to 0,0,0 and in this case your it will not come in your camera range.And don't make the public variable of Transform it will call it you default .
Your answer
Follow this Question
Related Questions
how to re-assign transform/rigidbody at runtime ? 0 Answers
Help with tractor technology 0 Answers
Pick Up Object using Rigidbody FPS 0 Answers
what are the ways to attach objects 1 Answer