[Release] Custom character controller


I uploaded the place files to Roblox as Uncopylocked Games for ease of accessibility and play testing

Hope you don’t mind.

5 Likes

I might as well post my version of the place on here as well:


I’m not sure if it will always be public, but it is here for now. Also keep in mind that I have not created mobile controls for this yet. For right now, only keyboard and mouse is supported.

4 Likes

I figured out how to get the camera movement specifically to tween instead of the entire angle, if you were stuck on that. I just made an extra xOffset value since the offset and part:fakePart relationship is basically coupled together.

This also bugged out the ControlScript, so I also made an extra camXSum variable under CameraScript to fix it.

Here are the individual scripts if you want to replace it, I also updated gravity swords up there to show this:

CameraScript.rbxm (3.6 KB)
ControlScript.lua (1.9 KB)

2 Likes

I also just integrated the custom ControlScript with Roblox’s default one. Literally added three lines and changed one line. Surprisingly easy.

ControlScript.rbxm (47.5 KB)

I also published the change to gravity swords up there.

This is apparently only partial so far…

Update: The CameraScript is huge, I got the Classic camera integrated, but the Follow camera is causing trouble…
All this is in a separate game, so it has not been updated yet.

Update to the update: I just integrated CameraScript’s Classic camera and Follow camera modules, which are the two camera types provided to the player on default:

CameraScript.rbxm (80.2 KB)

If you need support for additional camera types, you can reply to this post, and I will try my best to integrate those scripts as well. I just updated gravity swords up there to show it.

I will begin work for the modification of the entire up-to-date module, which already looks much cleaner!

1 Like

:shushing_face: Don’t give them my secret!

In all seriousness I am very excited about this especially with it being open source. Thank you and good work!


also I did miss how old this is, sorry if that is against etiquette

3 Likes

I have now integrated the entire PlayerModule, published on gravity swords:

PlayerModule.rbxm (125.6 KB)

This includes modifications to CameraModule.RootCamera, CameraModule.ClassicCamera, and ControlModule.BaseCharacterController. The ClickToMoveController doesn’t work because it requires a unique pathfinder, something I don’t think I have high confidence in creating because of its lack of correlation with the geometry of contorted unions and meshes.
I probably added about 100 lines in total, and it took me longer than it should’ve because of implementation details. Now that this is done though, this can be used as a component instead of its own standalone product, allowing for usage with other controllers, such as EgoMoose’s platformer controller, given the proper implementation.

I will need to unreverse X inputs when I get home
Done!

5 Likes

A cool idea would be nice like, when ur upside down your camera would rotate or move back to a normal fixed position so it just looks like nothing happened hhh.

Could you elaborate on what you mean by this? Are you suggesting some kind of cinematic camera? I could probably implement it into the CameraType.Watch Enum. The CameraType.Watch Enum is actually easier to implement in…

2 Likes

ok so basically, when you’re upside down on a part your camera should instead rotate like it was when you were normally on a surface part or something. hh

So like, you want an option to return the camera’s orientation to what it would be if it wasn’t accounting for gravity?

yeah, something like that basically.

1 Like

Sorry, just to be clear, you have seen @goldenstein64’s gravity swords place?

1 Like

Yeah, we have. Off topic, is there any way to make this character controller work when using swords, for example, have it support lunging and velocity changes?

1 Like

This will probably merit for a new method in the controller for accessing the physCharacter, honestly. Then you could apply physical BodyMovers and Constraint objects directly instead of via proxy to the real character. It’s easy to make, I could probably reproduce the code in this post real quick:

function controller:getPhysCharacter()
	return self.physCharacter
end

In an outside module, if you don’t want to use that method, the controller has physCharacter as a property, so you could probably access it from main in StarterCharacterScripts as:

controller.physCharacter
2 Likes

Doesn’t look like the place linked is uncopylocked

1 Like

Right you are! My mistake; I must have not hit save. It should be open now :grin:

3 Likes

This couldn’t have come at a better time because I’m working on modifying the CameraModule to use any direction as its up.

Before I slog through your modified CameraModule, is there any convenient way to use it in my own game without your custom controller? Ex. In my game, I have a custom bee controller in which bees can land on walls, and I want the wall to become the floor.

1 Like

Actually, the CameraModule is not modified all too much, EgoMoose tried to isolate as much controller-specific details as possible to the controller module in ReplicatedStorage.

Also, what do you mean by using it in your game without the custom controller? Do you mean just turning off the gravity part of the controller so you can just use the camera portion?

1 Like

That’s exactly what I mean – turning off the gravity while still using the camera portion. I’ll look through the controller tomorrow and give it a go.

1 Like

Thought I’d share this as a few weeks back somebody mentioned to me it would be cool if players could more accurately climb non-vertical ladders.

So here’s a very simple demo of that in action:

My point in showing this is to show that this module may be more versatile than you may think so get creative!

ladder.rbxl (165.0 KB)

21 Likes