I just started using unity this semester, and I am creating an octopus that spits ink and moves away (with an animation script) when the first person enters the box collider.
I am new with scripting so I made 2 separate scripts for each action. (probably not a very efficient way)
- one particle system with a box collider that produces ink when first player enters
- an octopus, with a box collider, that moves away when first player enters
I put the object and box colliders together at the same place so that both actions will happen when the first player enter the colliders
the problem is: the particle system and the 2 box colliders will stay there after the octopus has moved away. So every time the player goes to that area even when there is no octopus, the box colliders are triggered and ink will come out.
How can I attach the particle system and the box collider of the particle system and the octopus to the Octopus object, so they will move with the octopus?
Thanks!!
Take the octopus gameObject as parent in the hierarchy, and drag the other objects in to it so that they become the children and will move along with the octopus.
– UnitraxxI have tried that, but it did not work. The Octopus is the parent, and the particle system is a chld.
– CkmleeOnly a screenshot of the hierarchy and perhaps the different inspectors can give us an idea of what went wrong in that case.
– Unitraxx