OK, so I was going through the FPS tutorial to get a grip on Unity, and now I’m stuck. My RocketLauncher refuses to follow my FPS controller, even though mouse-pointing works.
Any help?
- Sahil
OK, so I was going through the FPS tutorial to get a grip on Unity, and now I’m stuck. My RocketLauncher refuses to follow my FPS controller, even though mouse-pointing works.
Any help?
Put the rocket launcher as a child of the Character Controller
Omar Rojo
I did that, but it still refuses to follow it. Whenever I start the game, the rocket drops about 2 pixels, maybe that has something to do with it?
does the rocket launcher have a rigidbody?
Yes it does. It seems like it should work, but it doesn’t. I did it right with the grenade spheres, but it doesn’t seem to work with this.
UPDATE: I skipped that part and did the machine gun, and that gun works fine, it’s just the launcher that doesn’t… now it seems that the launcher is going front when I hit back >.<.
PLEASE HELP.
Try to find the difference between the machine gun and the rocket launcher… if one works… i don’t have much experience with rigidbodies…
Omar Rojo
You don’t want the rocket launcher to have a rigidbody. If it has a rigidbody, it will interfere with the movement of the character controller.
–Eric
OK I got that part to work. However, projectiles now refuse to exit their respective weapons. In the H. View it shows rockets and particle systems beind created and then destroyed, but they can’t be seen in Scene View.
find the rocket you are instantiating in the project view. Drag into scene view, make sure you can see it. If you can, fine. If not look in the layers tab on the inspector-depending on how your doing this, there may be no camera spcifically rendering your rocket model. Move it in front of fps camera to be sure- you should be able to see it in game view. CMD-delete it from hieracy if all looks ok…
If you cant see it, Change its layer till you can. If its still not working, select rocket in scene, go through the categories in the inspector-make sure a renderer and a mesh to render is assigned.
Go well and be patient, this all takes time to understand…
AC
Everything renders fine. The first few shots taken seem to be all right ( a bit too much below aim though) but then they just stop appearing. I paused and checked the rocket’s location and it’s way below the level mech… anyone know why? Same with the machine gun, the bullets seem find except being below the aim and then just stop working.
If you have rigidbodies on your guns they will fall down due to gravity and act like physical objects should. They will not necessarily follow their parent.
The Rocket/gun models are children of the gameobjects with the relevant scripts, right? does the gameobject with the script match the position of the gun barrel tip?
The Rockets do “run out”, which is set in the inspector…
You dont have a timed object destructor on the machinegun/rocketlauncher GO’s with scripts attatched do you? If so remove…
I had a similar problem the first time I did this ages ago. I gave up, returnrd to it some weeks later and everything went fine…
Dont sweat it man. Everything gets easier with time…
The thing is, this Tech is so good, it makes us passionate, and stay up waaay too late, and the obstacles are infuriating.
But everything is possible. Developing 3d games takes a lot of skill, patience, and other stuff.
AC
ps if things are a mess, and your doing the FPS tut, just start over. Once you get it, you can apply these scripts fairly easily to most game types. HTH
Thanks for all the help guys! I think I’ve got everything settled (hopefully). WIll def. be getting the Pro version sometime.
For some reason the bullets and rockets don’t go forward… they end up hitting a random spot or flying way under the map…
I think I kind of know the problem causing all of this: http://www.imagewasp.com/uploads/3822Picture%206.png
Any help with what could fix this wierd aim.
Ignore the fact that my guns have different names. Does your hieracy look like this?
See where the gizmo is?right in the middle. Yours must be somewhere else. Dissconnect all your objects and position them where you see the axis gizmo in this pic, then reconnect. Your picture indicates that some object in your hieraqcy is away from the player creating an axis where you dont want it.
Unparent, reposition, reparent
AC
make sure the projectiles (rockets) have rigidbodies, just not the launcher-- I think the bullets are raycasts…