- Home /
Problems with velocity in Unity 5
Hi. When I do GetComponent().velocity = new Vector3(speed, 0f,0f); in Start function to a Unity Cube, the cube moves well. However when I do the same in a own object (model with 3d Studio) the object stop.
I have created a physic material without friction and the gameObject rigidbody properties (Unity cube or my own gameObject) have Drag 0, Angular Drag 0, gravity enabled and isKinematic disabled;
Thanks and sorry for my English level
$$anonymous$$aybe the object has weight, try to disable gravity or multiply speed by 100000 and see if it moves. If so you need a bigger force to push it.
$$anonymous$$ake sure that the "speed" has much value? in order to move object?
The only difference between the two gameObject, (one that uses the imported mesh, and the cube), should be the $$anonymous$$ESH selected in the $$anonymous$$ESH FILTER component. Everything else should be the same. Is this the case? What happens if you changed the selected mesh to your imported mesh, in the cube's mesh filter? (the gameobject wont be a cube anymore, but will keep the same name)
$$anonymous$$ake sure you added script that works for your imported object.
Answer by sebeisdrache · Mar 16, 2015 at 04:03 PM
try somehing like:
GetComponet<Rigidbody>().velocity = speedvector;
Answer by dcarpiom1985 · Mar 17, 2015 at 01:36 AM
The project was created in Unity 4.6. Today I updated to unity 5. In v4.6 the object works well, but in v5 the object stop.
In the other hand, I fix the problem apply GetComponent().velocity = new Vector3(1,0,0) in the FixedUpdate function.
Your answer
![](https://koobas.hobune.stream/wayback/20220613190307im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Player movement not working with unity 5 1 Answer
Problem reading/getting from rb.velocity value? 1 Answer
Velocity powered rigidbody on a moving platform without parenting. 3 Answers
Can't access the velocity of a rigidbody: 'Rigidbody' does not contain a definition for 'velocity' 1 Answer
Can't access rigidbody commands 'Rigidbody' does not contain a definition for... 2 Answers