简体   繁体   English

弹射器上的统一可控铰链关节

[英]Unity controllable hinge joint on catapult

My catapult consists of an arm and a base.我的弹射器由一个臂和一个底座组成。 The arm is connected to the base with a hinge joint.臂通过铰链连接到底座。 My goal is to be able to move around the catapult sideways with wasd/arrow buttons as well as the rotation of the arm with the scroll wheel.我的目标是能够使用 wsd/箭头按钮以及通过滚轮旋转手臂的弹射器横向移动。

I've managed to get it to work by having the arm on kinematic, however this results in the base not being affected by gravity.我设法通过将手臂置于运动学上来使其工作,但这导致底座不受重力影响。

What do i do?我该怎么办?

You could be toggling " isKinematic" thru script only when you need it and toggle it back off when not needed.您可以仅在需要时通过脚本切换“isKinematic”,并在不需要时将其关闭。 there is a rigid body boolean property you can easly set up:您可以轻松设置一个刚体布尔属性:

Rb.isKinematic = true; Rb.isKinematic = true;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM