I’ve recently been working on an FPS game and I’m starting with trying to modify the gun so that it will do what i want. As the gun i have modelled uses a secondary fire i have altered the zoom function to a different button, and i’ve made a right click function that will (in the end) fire a grenade. My problem is this:
I have changed the code so that when right click is pressed, the empty mag is added (which i will remodel as the grenade) with linear velocity along the x axis locally. The problem is, when the empty mag is added, and you’re not facing either directly forwards or directly backwards, it doesn’t fire along the empty’s local x axis properly. (Just so you know i have already done all the Alt-R and Ctrl-A stuff.)
Does anyone have an idea what the problem might be?
If it helps I’ll try and get a blend or some pictures posted at some point.
I know this is a week old, but i thought i’d just post and say that i’ve solved the rotation problem and the secondary fire works properly :D.
All i have to do now is get the grenade effect working which is in another thread i started here: http://blenderartists.org/forum/showthread.php?t=96024
Your half right, i did try alt-a, but that didn’t do anything, and i was stumped for a while, until i tried unparenting the ‘magspawn’ empty, and then rather than reparenting it back to the gun, i parented it to the camera instead, pressed p and it worked perfectly! and like i said i just need to get the the grenades (from my secondary fire) to explode and it’ll be perfect (except texturing )