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:
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
Post a Comment