unity3d - Move object in Unity 5.0 -


using unity 5.0 . write these codes move prefab:

gameobject policecarinstance = instantiate(policecar,enemyspawner.position, quaternion.identity) gameobject; rigidbody2d policecarrigidbody = policecarinstance.getcomponent<rigidbody2d>(); policecarrigidbody.velocity = new vector2 (0f, -10f); 

when animator component of prefab disabled, prefab moves correctly when it's enabled, prefab doesn't move. animation 5 sprites of different states of police car's lights. here's pic of animator of prefab:

object animator

this code same properties , states works on unity 4.6 (even when animator component enabled) in unity 5 doesn't work!

is there changes in unity 5 influence in rigidbody2d component?


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -