Help with default TPC RPG movement type

Edub101

New member
Hello. I'm using Unity 2018.3.14f1, and the latest version of TPC. I am a novice, and non-coder who is easily confused, so please forgive my struggles with even the basic setup. I'm trying to set up the Third Person RPG default movement type on an object. Specifically, a vehicle like a pirate ship or space ship. I've added the Game manager and updated layers and Input, which I assume means the default inputs listed in the manual are set. I used the character manager to set up the default movement type for Third Person RPG on an empty object with a simple child mesh to represent the ship. The defaults say "Q" and "E" should strafe, but nothing happens. Also, using "A" and "D" does rotate the character, but does so as if the pivot point is behind the character--like the hands of a clock--rather than rotate around the actual pivot point of the object, which is through the center. If I hold the center mouse button down, and turn with the mouse, the pivot is correct. What I would ultimately like is to have movement completely independent of the camera, so the camera doesn't affect character rotation and can freely look at the ship while the keyboard controls movement. I would like "A" and "D" to rotate the character around the vertical axis (like holding the middle mouse currently does), and "Q" and "E" to strafe. It may be worth noting that forward ("W"), reverse ("S"), auto-run (toggle "F"), and the RPG camera defaults seem to be working. I am not using animations yet, so root motion if off, and there is no rig or bones in the model. What settings should I use to strafe, and to fix the rotation so "A" and "D" spin the object around it's natural pivot (in this case, an empty object that should serve as a pivot)?

Thanks for any advice!
 
Instead of the RPG movement type it sounds like you'll want to use the adventure or combat movement type. If you're looking for more changes from those movement types it will require that you get into the code and create a new movement type. This page gives an overview on how you can do that:

 
Thanks for responding, Mr. Justin. I know how overwhelmed you must be from fielding questions after a Unity sale, which spikes the support requests by some exponential factor, I'm sure. I apologize for the poor wording of my question, which led to the impression that I was looking for something more complex than I was. I was trying to be descriptive, but ended up verbose. My bad.

I am almost certain that I wish to use the 3rd person RPG movement type and RPG camera to create a "sluggish spaceship" that navigates on a navmesh. In fact, it almost works now, with the exception of two issues that should work by default, but do not. I'll simplify my questions by separating them from my thoughts/discussion, but I have a third question that has come up which I also include:

Question 1: When I set up the default non-root-motion TPC RPG movement type, it should strafe using "Q" and "E" according to the manual. Nothing happens when I press "Q" or "E." Why?

Question 2: When I set up the default non-root-motion TPC RPG movement type, pressing "A" or "D" should turn the character, as should holding a button (default middle mouse) and rotating the mouse left or right. The second option works, but "A" and "D" do not. Instead of turning, the character "shimmies" along the radius of an invisible circle, facing outward from the center, like the hand of a clock, or a tether ball on a string, with the center point somewhere behind the character. Why?

Question 3: If acceleration rate somehow becomes maximum speed for non-root-motion characters (color me bewildered!), how does one change the acceleration rate? And can there be a minimum speed (e.g. a character that changes speed, but always moves)?

Thoughts/Discussion - Question 1: I think there is something going on with the Input set up manager. Since my original post, I downloaded the TPC sample scene to see if that helped, but many inputs didn't work (it is not the UCC demo scene, but the TPC one). For example, there are instructions to "press escape" to switch movement types, but doing so just frees the mouse cursor. Later I can press "enter" to change to 3rd person RPG mode, but there is no strafing as described in the documentation. The "Q" and "E" may instead be defaulting to some sort of weapon switching set up, according to the keymaps displayed after pressing "F1." Maybe the default strafing is just not being set when I use the Update Input manager for my spaceship? In the UCC component in the inspector, I see options to change several things, like which button to hold down to turn via mouse (default middle mouse), or the speed multiplier when going backward. But nothing about strafing input or strafing speed multipliers, so I can't tell what the default is. It feels like I'm missing a component that should have those.

Thoughts/Discussion - Question 2: When I use the demo scene, "A" and "D" turn the Nolan character correctly, and he does not act like a clock, but I suspect that he is using root motion animation to turn. Maybe I need to change a setting to make a generic, non-root-motion character turn using "A" and "D" in the correct way? Since holding middle mouse turns my spaceship correctly, I assume I don't need animation to turn. I just want it to turn in the same way when I press "A" or "D" and the manual suggests should happen. The "clock/tether ball" effect is reminiscent of what I would expect from a First Person perspective controller. Could it be that something is wrong as a result of my having only the TPC, and not the full UCC? Is the system trying to give me a first person view, using the camera as the character? I don't have the camera as a child of anything.

Thoughts/Discussion - Question 3: I'm quite confused about speed and acceleration. My searching in the forum suggests that acceleration rate--which should be the change of speed over time--becomes some sort of maximum speed (only speed?) for non-root motion characters. When I change the acceleration rate, the character does go faster. But what is happening? What unit is this new speed variable in...Unity distance units per second...per frame...something else)? My spaceship is going from zero-to-whatever instantly. How do I make the acceleration slower, if acceleration is now speed? I want the spaceship to increase speed slowly over time. I wouldn't mind being able to set the minimum speed too, although that is more for my plans with Behavior Designer, to make AI spaceships not stop-and-go like people when wandering.

Did I mention I can count on exactly one finger the number of OPSIVE products I do not own, including the deprecated ones? That makes me one product shy of being "tied-for-first" as your literal best customer! I only mention this to apply a measure of guilt, so you feel obligated to help me even though I am one of those dreadful "non-coders" who need so much hand-holding. Your previous suggestion to "code my own movement type" was equal parts amusing and terrifying. Thanks for your patience, and your help, Mr. J.
 
Question 1: When I set up the default non-root-motion TPC RPG movement type, it should strafe using "Q" and "E" according to the manual. Nothing happens when I press "Q" or "E." Why?
That's a good question - I just tried the demo scene and Q/E didn't work either. I'll look into this and if it's a straight forward fix I'll post it here.

Question 2: When I set up the default non-root-motion TPC RPG movement type, pressing "A" or "D" should turn the character, as should holding a button (default middle mouse) and rotating the mouse left or right. The second option works, but "A" and "D" do not. Instead of turning, the character "shimmies" along the radius of an invisible circle, facing outward from the center, like the hand of a clock, or a tether ball on a string, with the center point somewhere behind the character. Why?
I'm not completely following what is going on - can you reproduce it within the demo scene? A/D rotation doesn't use root motion to rotate and when I tried it within the demo scene I was able to rotate.

Question 3: If acceleration rate somehow becomes maximum speed for non-root-motion characters (color me bewildered!), how does one change the acceleration rate? And can there be a minimum speed (e.g. a character that changes speed, but always moves)?
Acceleration combined with the damping value will determine your velocity. This isn't a straight forward calculation because it depends on the timestep but with the default values the character has around a 4 unit/sec velocity magnitude.

Did I mention I can count on exactly one finger the number of OPSIVE products I do not own, including the deprecated ones?
:) Thank you for your support (we're working on getting deathmatch back)!
 
That's a good question - I just tried the demo scene and Q/E didn't work either. I'll look into this and if it's a straight forward fix I'll post it here.


I'm not completely following what is going on - can you reproduce it within the demo scene? A/D rotation doesn't use root motion to rotate and when I tried it within the demo scene I was able to rotate.


Acceleration combined with the damping value will determine your velocity. This isn't a straight forward calculation because it depends on the timestep but with the default values the character has around a 4 unit/sec velocity magnitude.


:) Thank you for your support (we're working on getting deathmatch back)!

The Nolan character in the Demo does turn correctly on its axis with the "A" and "D" keys. Which is why I think something weird is happening with my creation process. Here is literally every step I took, using a new project (latest Unity 2018) and new import of Third Person Controller (not full UCC).

1: From default scene, create Unity terrain.
2: Create empty object named Player, at (0,0,0), tag as Player.
3: Add Unity cube as child of Player to represent spaceship, scale it by 10 on z axis, and 3 on the x and y axis to make it look more like a large ship.
4: Raise cube 3 unit above empty Player object (along y axis) so it is “flying” a little above the Player object.
5: Using OPSIVE setup manager’s scene tab, I press “Add Managers” then change camera view type to “Third Person RPG” and press “Set up camera.” I don’t press UI or Virtual Controls.
6: Switching to Project tab, I press “Update Buttons” and “Update Layers.”
7: On character creation manager’s “New Character” tab, I drag in the Player root object from the hierarchy to the character slot, and select “Third Person RPG” for the movement. The model is “generic.”
8: Although I don’t have animations currently, the setup requires an animator controller to complete, so I create an empty controller called spaceshipAC, and drag it to the slot. I deselect all of the Advanced options, then press “Build Character.”
9: I drag the Player object toward the center of the terrain so it doesn’t fall off the corner, save the scene, and press play to test.

--the “A” and “D” keys should rotate the Player around its y axis, like Nolan in the demo, or holding middle mouse and rotating (which does work) but instead, "A" and "D" are acting like a first person camera, where the player object is a weapon.

Keep me posted on what you figure out!
 
Thanks for the steps. On the Camera Controller did you select the RPG View Type?
 
Yes, during step 5 above. To be sure, I just checked the scene and can confirm that the "Third Person RPG" is the camera view-type listed in the inspector on the camera's "Camera Controller" component, and "Third Person RPG" is the movement type on the Player object's Ultimate Character Locomotion component.

Below are the two turning actions in GIFs. The top is A and D (incorrect) and the next is rotating with mouse button held down (correct).
 
Last edited:
I figured out why Q/E doesn't work - the Alt Horizontal input mapping wasn't setup for it :) If you open the Unity Input Manager and change the mapping then that will work again.

I just remembered a configuration that may be different - when the RPG Movement Type is activated within the demo scene the RPG state is activated. This changes the Horizontal Input Name on the Ultimate Character Locomotion Handler to "Alt Horizontal". If you make that change on your end does everything start to work correctly?
 
I figured out why Q/E doesn't work - the Alt Horizontal input mapping wasn't setup for it :) If you open the Unity Input Manager and change the mapping then that will work again.

I just remembered a configuration that may be different - when the RPG Movement Type is activated within the demo scene the RPG state is activated. This changes the Horizontal Input Name on the Ultimate Character Locomotion Handler to "Alt Horizontal". If you make that change on your end does everything start to work correctly?

Sorry, I can't figure it out. For the Q and E strafing, under Alt Horizontal, the default is set to "z" and "x" but those buttons do nothing by default. I added "q" and "e" as alternative buttons, but that didn't do anything either (as expected, since the "z" and "x" didn't work). I also added "q" and "e" to the regular "Horizontal" input (as opposed to Alt Horizontal), but no luck. Still no response with the default set-up I described earlier.
1340


And as for the weird rotation with "A" and "D", I can't figure that out either. I don't understand the state system, but I tried to change the name of the state in the UC Locomotion Handler from ThirdPerson to RPG, if that's what you meant. It didn't change anything.
1341


Without using the demo scene, if you just start a new project and follow what I did step by step in the earlier post (the simplest TPC RPG setup possible, with just a cube), what exactly would I change, and where, to make the basic setup work? I actually don't want most of those example scene inputs anyway, just the default controls listed in the pdf manual. Maybe a screenshot of what to change that makes it work for you? If you reproduce that basic setup, do you see a step I'm missing?
 
Ok, I saw your response to another thread about changing the name of the horizontal input in the Locomotion handler (easily confused with the other locomotion script) to Alt Horizontal. Does the "Turn input name" in the regular UC locomotion script, (which is still "Horizontal") do nothing? I changed the one in the "handler" to Alt Horizontal, and it did make the "A" and "D" keys correctly turn the character! Alright! But here is the thing...."A" and "D" are not assigned to Alt Horizontal in the input manager. "Z" and "X" are. And "Z" and "X" now make the character strafe, as do "q" and "e" when I add them. So how is "A" and "D" making the character turn....where are those letters coming from? Isn't "Horizontal" supposed to control turning, and "Alt Horizontal" supposed to control strafing? Are some of the inputs for the Third Person RPG hard-coded? I guess I'm asking for an explanation of the Ultimate Character Locomotion (script) vs. Handler, and how they impact the assigned unity buttons in the unity project settings, and what each motion (like strafe vs. turn) is supposed to be called. I'm starting to get the controlls to work, but it doesn't feel like this is how things are supposed to be. I guess it technically does work, so I will mark as solved (but confusion remains).
 
Last edited:
And I still can't get "q" and "e" to strafe.
Instead of Q and E being alt negative/positive button in the input manager, they should be the normal negative/positive button.

1347

In the next version when you click "Update Input" on the main manager it'll correctly assign these button mappings.
 
Top