- Home /
Question by
Trild123787898 · Jan 08, 2019 at 07:04 PM ·
animationphysicsscript.transport
Attachment of equipment for transport
When the transport runs up to the object trigger, when you press a key in me, the script that comes to me is parental, the problem is that there is a space between them here
here is the script
public class Trigger : MonoBehaviour {
private void OnTriggerStay(Collider other)
{
if (other.CompareTag("Player"))
{
if (Input.GetKeyDown(KeyCode.E))
{
transform.SetParent(other.transform);
}
}
}
void FixedUpdate()
{
if (Input.GetKey(KeyCode.R)) {
transform.parent = null;
}
}
}
The question is, how is it possible that when you press a key, the script and the hardware will be placed in this way! Is it possible with the help of animation? Or is there another way!
130569-tracto1.png
(203.2 kB)
Comment
Your answer
Follow this Question
Related Questions
How best to implement attaching an object to a transport? 1 Answer
Attachment of equipment for transport 0 Answers
How to make Animation and Physics work together? 2 Answers
How to make Animation and Physics work together? 0 Answers
Physics not applying to the animated object after the animation ends ?! 0 Answers