gameObject can't move and collide after setting it off and setting it on again.
Hey mates!
First of all, I got a pool of gameObjects. Everytime I set off any of them and set it on again the rigidbody doesn't have the same behaviour as when it was active for the first time. For the movement I use rigidbody.MovePosition(); I have blocked the constraints and gravity on rigidbody. Anyway I've tried to active them and it does the same.
Hope you can help me!
Best regards,
Can we see your code? It is extremely difficult to fix a problem if we cannot see what you did wrong. Cheers.
Yes, ofc.
This is what I use to move the gameObject.
void $$anonymous$$oveEnemy() {
enemyRb_.$$anonymous$$ovePosition(transform.position + Vector3.left * speed_ * Time.deltaTime);
}
And this is what I do when I set on again the gameObject.
public void RestartEnemy(){
dead_ = false;
gameObject.SetActive (true);
}
Your answer
Follow this Question
Related Questions
How to throw an object towards a hit.point in first person? 0 Answers
Control speed of a rigidbody that move to a fixed distance 2 Answers
Rigibody constraints do not work. Still moves a little. 4 Answers
First Person Slide in direction of rigidbody movement and not look direction 1 Answer
How to: rigidbody.MovePosition to player's position 2 Answers