Hi all, i try to do my first shoot but i have one problem (I am new in Unity3D).i Have this code: Before add this line
'Disparo' is the script that i show before.. So.. What happend? my gameObject only move when i push it with others gameObjects (same gameObjects) Here some pics.. In the Screen Shot UnityShoot you can see that only when i clicked 3 times if when one gameobject fly! :( Please Help i want to keep learning ScreenShots 125 http://www.dropbox.com/gallery/45494271/1/Screen%20Shots%20Unity3D%20FPS?h=317b52
(comments are locked)
|
|
Mr. aldonaletto Thanks very much for help me.. when i change ForceMode.velocityChange for ForceMode.VelocityChange it's work but it not take the rotation of my camera (always shoot in one direction), but when i set there line for: All Fine! THANKS VERY MUCH.. But now i want to know why my old code not working, i'll read more for this and keep learning for understand what happend, one more time thnks for your time! your answer WORK PERFECTLY
(comments are locked)
|
|
Based on the pictures you provided, it should work - the only problem is ForceMode.velocityChange: it should be ForceMode.VelocityChange. Anyway, this code will make the bullet go in the Z direction; you should use cloneBala.transform.forward instead. You could also set rigidbody.velocity instead of using VelocityChange:
(comments are locked)
|

Do you have a rigidbody on your prefab? It looks like it can't find the component! Otherwise, try putting an 'as GameObject' after your instantiation line (between the last bracket and the semicolon)