- Home /
RigidBody - GameObject moves but mesh stays!
I need to have moving GameObjects and I need them to be destroyed when they enter another GameObject.
To be able to detect when they enter the trigger, it seems they need to have RigidBody. I set IsKinematic so physics are not applied. Please note I would prefer not to use RigidBody, but it seems impossible to easily detect if the GameObject enters the trigger otherwise..
Now the problem is when I have 2 objects with RigidBody, the GameObjects move but not the render.
Here's a screenshot of properties of one of the GameObjects and the GameObject they will enter
Code for the EnemyController
using UnityEngine;
using System.Collections;
public class EnemyController : MonoBehaviour
{
public float velocity = 0f;
void Update()
{
transform.position += new Vector3(0, 0, velocity * Time.deltaTime);
}
}
I need advice on how to set this up properly. Going mad over here.. Thank you!
Oh god. That was it! Thank you rutter. If you write it as an answer I'll accept it :)
Answer by Rubens-Torres · Aug 22, 2014 at 03:21 AM
this is probably occurring because you put the collider object and one or more objects parented to it so can cause a problem because the object that has the render and collider may be colliding with something while the other has no render does not collide in nothing, and so goes his way alone, try putting all colliders on an object, and the object with the render as a child parented to it might work, sorry for the mistakes of writing I do not speak english very well I hope you understand ^^