English 中文(简体)
统一——OnTriggerEnter不称为
原标题:Unity - OnTriggerEnter is not being called

我愿提供一个有多种鱼类存在的四分之一。

我试图不要让鱼类通过ube子,但OnTriggerEnter的功能即使物体进入触发点,也无所作为。

These pictures represent each of whale and cube inspector factors. whale inspector whale inspector

“cube探测器”/

最佳回答

仅需在鱼体上添加<代码>Collider(与/code>的同级,或放在儿童上)。 HolObject

OnTriggerEnter will only fire when a Collider into a Trigger Collider

见MonoBehaviour.OnTriggerEnter(Collider)

问题回答

我猜测你缺少其中一些东西:

  • Add RigidBody to the fishes
  • Set the Collider of the GameObject that will detect the fishes as is trigger. And leave it unchecked in the Collider of the fishes

www.un.org/Depts/DGACM/index_spanish.htm

从您的最新屏幕来看,你本应检测触发器的锁脚本是 而不是 。 只是把它附在两条相互勾结的游戏中。

Ok so I ve had this problem before. Something that helped me A LOT was to MAKE SURE YOU CREATE YOUR SCRIPT IN YOUR OBJECT. It s just easier.

如果在你打上OnTriggerEnter的空白时,你打上了你的笔记,那么就没有任何建议要填写OnTriggerEnter。 如果你在标语中制造该词,不如建议填写“OnTriggerEnter”。

或你再次找不到一个 coll或 rigid子。

我也想加上“物理-和;自主模拟=虚假”,这将绝对停止测量。





相关问题
Finding the angle of a fleeing dodo

I want my critter AI to run directly away from the player when the player kicks it, and I don t know the math nor the syntax to calculate that angle. They are two characters moving independently ...

Game engines for iPhone vs. native iPhone sdk development

What are people s opinions and/or experiences with game engines such as Unity or Torque Engine? If one were new to iPhone game dev is it worth it to learn one of the engines? What is the performance ...

Random 2d movement (similar to flies) in Unity3d

I want to add random movement to some of my game objects similar to the way flies swarm in Unity3D. I ve developed a method using the addforce() method but would like to bypass the physics engine. ...

热门标签