Why my object have velocity , but it can't move follow it's velocity?

if (Input.GetMouseButtonUp(0))
{
aimMode = false;
bulletRb.isKinematic = false;
bulletRb.velocity = -tempPosvc;
print(bulletRb.velocity);
bull = null;
}
here ,I tried to follow this book to make a second game . I have a object named bullet , I get it’s rigidbody : bulletRb, I set it’s velocity when I press mouse button , I use a float value * a mouse position to point to the emitter position as the value of its speed ,but it doesn’t work , it’s motion like it’s speed is 0,it just fall down because it’s gravity ,but I print it’s velocity , it have value . What’s more strange is when I modify it’s velocity from -tempPos
vc to tempPos*vc , It’s back to normal.And it’s the same result when I copy the source code from the book.
[121715-qq图片20180729004657.png|121715]

To me it looks like your “bullet” (which is public) actually holds a reference to a prefab. From the little code preview on the right of your image we can see you actually have another gameobject reference called “bull” which most likely is an instance of your prefab “bullet”. However we don’t see where you may instantiate that prefab. Are you sure you get the Rigidbody from your bull object and not from bullet? If you get the rigidbody from the prefab it won’t affect the instantiated / cloned object.

We don’t see enough of your code to give a more precise answer. Note you should rename your “tempPos” variable as it doesn’t represent a “position” but a direction. Without seeing the preview code in the image i would have assumed it actually represents a position and that most likely would be wrong. It’s extremely misleading calling a variable “banana” when you store the current time in it. Many people seem to be lazy when they name their variables. As long as you know what you mean by that it’s fine. However as soon as others should work on your code it becomes a problem as the purpose of a code snippet is not clear to us if the variable names are misleading.

thank you answer my question,but I found the reason for the problem , I have instance of my prefab “bullet” in onMouseDown() method , I 'm sure I get the Rigidbody from my bull object and not form bullet , the reason is I haven’t open isTigger switch in my Launching object .

So I only can let it go out at the edge of the emitter, and if the velocity was the opposite, it would hit the object’s collider and cause the velocity to go to zero in an instant.

if (Input.GetMouseButtonUp(0))
        {
            aimMode = false;
            bulletRb.isKinematic = false;
            bulletRb.velocity = -tempPos * vc;
            print(bulletRb.velocity);
        } 

this is how I test my velocity ,it only get velocity when I press mouse button , but in next frame , it hit emitter collider , so it’s velocity will turn to zero in an instant.

The reason of problem is I haven’t open isTigger switch in my Launching object . So I only can let it go out at the edge of the emitter, and if the velocity was the opposite, it would hit the object’s collider and cause the velocity to go to zero in an instant.