Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:
Ambiera Forum > CopperCube > Announcements and Showcase
Thirdperson Camera and Player Controller + Download
Author Text

smnmhmdy
Registered User
Quote
2021-03-05 20:28:13

The first version of my Thirdperson Camera and Player Controller.
It is a proper, modern and conventional third person camera and player controller, featuring things like collision detection, material specific footstep sounds, customizable keys and sensitivity (at run time), shoulder view and more.

[How to use]
Create a simple camera and attach "SM Thirdperson Controller" to it, then attach the built-in "First Person Shooter style controlled" and set the "MoveSpeed", "RotateSpeed" and "JumpSpeed" to 0. Make sure SM Thirdperson Controller is above the FPS style controlled in the action manager.
Now set the player node and change any settings that you want in the behavior. That's it!


[Download] + Demo (v1.5)
Behavior:https://www.dropbox.com/s/4bxyre...
Demo:https://www.dropbox.com/s/ukmev9...

[Notes]
- Change the sensitivity at runtime using smTPCAMERA.Sensitivity (js) or by setting the value of "Sensitivity" using "Set or change a Variable" action.
- The shoulder view is a bit buggy as of right now. You have to use a more aggressive angleClamp value if you're going to use it.

Make sure to check the included ccb file if you have any problems, and ask your questions in the forum or the discord server:http://discord.gg/e6TpKsq

Let me know what you think, Can't wait to see what you guys will create with it :)


hadoken
Guest
Quote
2021-03-05 21:22:50

@smnmhmdy

Congratulations!!! You did it! You did a trillion fantastic job!
I'm so grateful and dearly appreciate what you accomplished as probably every CC user here. THANK YOU.

The Missing puzzle piece: I almost suspected it, you use the FPS Cam as alternative for overcoming horizontal mouse movement restrictions bundled with a sophisticated controller script for it. Wonderful! You're a true genius!

If you please make an itch.io donation page & I'll see what I can do for you. :-)))

So, here we go folks!!! Who's gonna make the first CopperCube Skyrim ;-)

P.S. Also love your suggestion for use as a vehicle controller.


jimpolygon
Guest
Quote
2021-03-06 00:14:50

Excellent!

I remember requesting a "Better 3rd Person Camera Behaviour" some months ago. Now here lies the Holy Grail of CopperCube's 3rd Person Controller. Thanks for public sharing!


just_in_case
Registered User
Quote
2021-03-06 03:00:45

Thanks a lot for sharing this wonderful behavior with the community. It is a huge aid to coppercubešŸ˜‡

Edit:- Uploaded this on my website here.
https://neophyte.cf/Assets.html

gonna try using it with my Gta VC clone.


smnmhmdy
Registered User
Quote
2021-03-06 08:50:50

@hadoken @jimpolygon Thank you! There's still more work left to do though, We have to fix the shoulder view and rewrite the SmoothRotation function. As well as doing a little bit more work on the collision detection... I have more plans for the newer versions too, such as a implementing a walk-jog-run cycle and smooth transitions between them to have a more realistic movement handling.
All in all, I'm happy with how it turned out to be

@ Thanks for uploading it to your website, I would love to see your VC clone, make sure to share it with us when you're done


smnmhmdy
Registered User
Quote
2021-03-06 13:42:21

Just reworked the collision detection, now it works both much better and more efficient. It fixed the extreme clipping with complex geometries (like terrains) and also the clipping when the shoulder view is used. Just updated the download link


marcw
Registered User
Quote
2021-03-06 14:32:40

Hello everybody,

Smn Mhmdy, thank you very much for your custom-made TPP Camera behavior.

It is a great gift to this community and I am convinced that it will stimulate the creativity of the games developers of the CopperCube's community.

I played with the two versions (1.0 and 1.1) and it works nicely.
For the fun, I selected a "tree" as the player.

Do you think that in a future version it would be possible to apply your behavior in a project where the Physics Engine is switched to "Physics Simulation" ?

:-)


smnmhmdy
Registered User
Quote
2021-03-06 17:31:41

@marcw Hey marc, happy that you had fun playing around with it. It should work fine with physics simulation turned on, are you having problems with it?


hadoken
Guest
Quote
2021-03-06 18:11:21

Thank you once again smnmhmdy!

1.1 is still even getting better. What a pleasure to navigate player & camera with your well set & superb working features through the narrow tunnel without any hassle.

Before I would take a more closer look into your script myself for it, do you think it would be easy to implement an extra keyboard triggered switch for toggling between: "Player always face camera look direction <-> Player always face camera look direction only when moving" at runtime? I assume it would surely only be the setting of the corresponding variable per extra defined key event, right?


smnmhmdy
Registered User
Quote
2021-03-06 19:36:04

@hadoken Of course, It would be really easy too and you don't even need to change the source. Just use When a key is pressed action and execute this javascript code inside of it:
smTPCAMERA.alwaysFaceCamDir = !smTPCAMERA.alwaysFaceCamDir;


While I was testing it I noticed there's a "bug" that prevents the player rotation even when walking. I say "bug" because if you think about the name of the variable it says ALWAYS face camera direction. So I guess it should always face the player towards the camera dir. I'm gonna add a new variable called idleFaceCamDir or something, which will only force the player's rotation when the player is idle and not moving. I think that would make more sense.

Edit - Just updated it once more to fix those issues, along with more little improvements here and there. Also added that idleFaceCamDir variable.


hadoken
Guest
Quote
2021-03-06 20:50:21

@smnmhmdy thanks for the reply

Setting "smTPCAMERA.alwaysFaceCamDir" to either true or false with even one key by a little variable math works like a charm.

Adding a "idleFaceCamDir" var sounds good to me. When having selected not-always-came-view-facing mode I also actually like how the player is explicitly not aligning to camera facing view when walking sidewards or backwards. By that users also have the chance of viewing their avatar roaming the world from another angle, thus maybe allowing for another level of immersion. So giving the user options & letting him/her decide about facing directions or perpective viewing angles in game runtime will definitely be an outstanding solution.


marcw
Registered User
Quote
2021-03-06 21:52:56

Smn Mhmdy, about "Physics simulation turned on", it is quite possible that I have a skewed vision of the CopperCube's possibilities.

I thought that the player would be able to climb stairs or hills when the physics simulation is enabled.

I also played with your version 1.1.2 with "Collision Only" enabled in the Physic Engine. Your behavior works nicely as expected. However I adusted the size of the collision cage for the player in your demo. The new one is (4,8,4).

My hope is the creation of a little game with Coppercube and I'll surely use your TPP camera behavior for that purpose.

Thanks again for sharing your expertise.

:-)


floydness
Registered User
Quote
2021-03-07 01:08:26

I've been trying all day to set up 3rd person shooting
with your behavior with no luck. This is my first time setting up 3rd person shooting to begin with so I'm wondering if using your system it's going to have to be done differently.
I'm getting close but have run out of ideas how to make it work out properly. I've had CopperCube a long time but just recently tried using it..Any help appreciated. Thanks


smnmhmdy
Registered User
Quote
2021-03-07 08:29:09

@hadoken Yeah, Maybe someone wants to make fallout 3/nv style game and alwaysFaceCamDir might come in handy for them

@marcw Yeah, Not being able to climb stairs or steep slopes and getting stuck in terrains and objects is one of the limitations of using the physics engine. Have you tried changing the colsmalldistance? You can get good enough results by messing with that and the collider size.

@floydness Are you attaching the behavior to your camera? Attach "SM Thirdperson Controller" first, then attach the built-in "First Person Shooter style controlled" and set it's move, rotate and jump speeds to 0. then go back to SM Thirdperson Controller's properties and select you player node that you want to control. Try taking a look at the demo ccb to see how its set up there, and if you still have problems you can send your ccb file so I can see why it's not working.


floydness
Registered User
Quote
2021-03-07 14:15:20

I've got everything working except the pistol won't stay in
the hand. I've got the right hand as child of the man(player) and the pistol as child of the right hand. I've carefully placed the pistol in the hand but when I walk the pistol trails behind the hand. I don't think it has anything to do with your behavior.
When I activate the shoot pose the pistol is right where it needs to be it's only in the walk animation...so it looks wonky


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (you are not logged in)


Text:

 

  

Forum Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons