Third Person Shooter Movement Example File

I like this template. Looking forward for more. :slight_smile:

I have done something like this… but completely different…

I use physics,

I wonder if we could “mix” the two?

BPR, have you looked at the code?

This is just great! I’m thinking, it would be awesome if it’s possible when player is close to wall,camera to move closer, instead of moving through the wall?

using a real physics bound on a dynamic or rigid body camera and linking using 6dof does this, but you need a low near clip distance

Moving the camera in front of walls is pretty straightforward, just cast a ray from the player to the camera and if it hits anything move the camera to the hit location (or slightly in front of it). If it doesn’t hit, then move the camera back out to full distance. That’s pretty easy to whip up quickly, I’ll go ahead and do it. Most of the other stuff I have been meaning to do are rather larger investments of time and testing…

[edit] there it is. Not perfect, but functional.

Attachments

TPS Walk Rig 0.0.61.blend (1.61 MB)

Thank you, its beautifull. I would do it myself if it was so easy, but I can’t code if my life depended on it :smiley:

Can anyone tell me which objects to append into my project to get the player working in my project? I would like to test this player out on a large ANT landscape with a POG script, are there any foreseeable errors or issues? Thanks in advance

This template is the best I have ever seen, it works great.

I have one question I don’t understand. In version 0.0.6 when I move the bone “CamParent” the Camera updated very smooth in 3DViewport. How is done without drivers, constraints or rigid body constraints? Looks very cool.

Edit: I found it… whew!

Don’t you hate it when people do not read your instructions in text editor? :stuck_out_tongue:

Messed around with the latest version for a little while now, great stuff!

I made quite a few changes to things, mostly to make it less “janky” feeling.

First thing I did was change the foot rig, only because I wanted to test out a foot rig I’m using myself and see how it works, was really easy to setup and works great!

As I was testing things out, I noticed the character “popped” around alot, so I went into the code to check things out. I am by no means a coder or anything like that, I can barely use logic bricks lol. I was able to find out the main cause of this popping, and make a quick fix, although it isn’t perfect. Basically I moved lines 331 and 332 below line 325. This made it to where the root bone would only be displaced if the feet are being displaced. The character still pops to the ground, but not nearly as much, and most importantly you don’t “pop” up in the air when you get off the ground. I think the complete fix for this would be to have a “grounded state”, and ONLY run the foot to ground matching system when the character is grounded. Also a falling state with a falling animation would be nice.

I also did alot of other small changes, such as small value changes to movement speeds and animation speeds, as well as changing every character animation in some way, almost all of them completely different from scratch. Threw in a quick day/night sky system I played around with a while back as well just for the heck of it.

There are some things I couldn’t fix because I know very little about coding, one thing is the camera moving closer to you when something gets in the way, if you walk forward into a wall kind of sideways with your right side touching the wall a bit, the camera goes inside of the wall.

Another thing is the gun recoil, after you shoot and the gun moves up, it should go back down to its original spot. It should also be randomized directions instead of always just going straight up. Would also be nice if the laser stayed on when you shoot.

Oh and another thing I noticed is that when you start the game, the character rotates 90 degrees to the left?

I feel like I’m forgetting some stuff, but this is already longer than I expected so I’ll just link a blend of my version below, again thanks for this and great job! Looking forward to more updates :slight_smile:

Attachments

test_v3.blend (639 KB)

Nice work, I could use the fluidity this displays :smiley:

Mix in my camera and it’s set :smiley:

Do you think you may be able to add in a carrying state?,
that uses a empty rigid body as a target? check this video (I know it’s terribly done here)

Another thing, if you had the mesh that will be deformed by this change alpha during aiming that might be cool :smiley:

Attachments

3rd_person_cam_beta (1).blend (469 KB)

Amazing! Going to follow this thread! :slight_smile:

Why doesn’t this work with the Standalone Player? Ground and player is black.

Try using constrains on the lamps instead of parenting to the player.

Also, the mouselook is really funky, or to sensitive or difficult to aim, it doesn’t feel analog, and some degress does not seem possible to aim at.

Because those objects no have materials(you need add a material for those objects), sorry english :smiley:

Its Really Cool !!! i need to learn this :smiley:

i found bug when you aim then you look down, it’s blank
(sorry bad english)

This is awesome, the camera collision from test_v3 could do with work.
Maybe a controller support would be amazing ?? please continue this
as this is really helpful.
How would i go around rigging this to my own character ?

guys, First of all, thanks for this template. It’s cool. i’ve been playing the test_v3 file for awhile. All the other controls like walk and run works but when I press the right button of the mouse for ‘aim’, the blender crashes. :frowning:

Guys, any idea why blender would crash when I press the right button for ‘aim’? :(:frowning:

Now I know the reason why it crashes… It’s the latest build of blender that causes the problem. 2.68 works fine

This is absolutely amazing!
And indeed it does crash on 2.69 when the aim button is pressed.
Here’s the crash log:

Blender 2.69 (sub 8), Commit date: 2014-01-08 04:40, Hash 8aaf4aa

backtrace

/usr/lib/blender/blender() [0xc2adc6]
/lib/x86_64-linux-gnu/libc.so.6(+0x370b0) [0x7f0033a670b0]
/usr/lib/blender/blender(ZNSt4listIP12RAS_MeshSlotSaIS1_EEaSERKS3+0xa0) [0x161dfe0]
/usr/lib/blender/blender(ZN12RAS_MeshSlotC1ERKS+0x16c) [0x161cf6c]
/usr/lib/blender/blender(_ZN18RAS_MaterialBucket8CopyMeshEP12RAS_MeshSlot+0x25) [0x161d045]
/usr/lib/blender/blender(_ZN14RAS_MeshObject11AddMeshUserEPvP8SG_QListP12RAS_Deformer+0x10d) [0x161eaad]
/usr/lib/blender/blender(_ZN13KX_GameObject11AddMeshUserEv+0x5b) [0x159a68b]
/usr/lib/blender/blender(_ZN8KX_Scene20AddNodeReplicaObjectEP10SG_IObjectP6CValue+0x145) [0x15cd765]
/usr/lib/blender/blender(_ZN8KX_Scene16AddReplicaObjectEP6CValueS1_i+0xe3) [0x15ce483]
/usr/lib/blender/blender(ZN8KX_Scene11PyaddObjectEP7_objectS1+0xa9) [0x15cba29]
/usr/lib/x86_64-linux-gnu/libpython3.3m.so.1.0(PyEval_EvalFrameEx+0x613d) [0x7f003a197f3d]
/usr/lib/x86_64-linux-gnu/libpython3.3m.so.1.0(PyEval_EvalCodeEx+0x816) [0x7f003a19acc6]
/usr/lib/x86_64-linux-gnu/libpython3.3m.so.1.0(PyEval_EvalCode+0x3b) [0x7f003a19afab]
/usr/lib/blender/blender(_ZN20SCA_PythonController7TriggerEP16SCA_LogicManager+0x76) [0x1612ec6]
/usr/lib/blender/blender(_ZN16SCA_LogicManager10BeginFrameEdd+0xb0) [0x160e8d0]
/usr/lib/blender/blender(_ZN15KX_KetsjiEngine9NextFrameEv+0x272) [0x15a8942]
/usr/lib/blender/blender() [0x1524ef8]
/usr/lib/blender/blender(StartKetsjiShell+0x104c) [0x152617c]
/usr/lib/blender/blender() [0xcf36a4]
/usr/lib/blender/blender() [0xc3179a]
/usr/lib/blender/blender() [0xc327ab]
/usr/lib/blender/blender() [0xc32a7d]
/usr/lib/blender/blender() [0xc331c6]
/usr/lib/blender/blender(wm_event_do_handlers+0x32b) [0xc3365b]
/usr/lib/blender/blender(WM_main+0x18) [0xc2c198]
/usr/lib/blender/blender(main+0xd7f) [0xbf76af]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f0033a51ea5]
/usr/lib/blender/blender() [0xc298f1]