Search Unity

Character Controller Pro

Discussion in 'Assets and Asset Store' started by lightbug14, Jan 15, 2020.

  1. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    That's very interesting!
    I always only considered doing it with the way you mentioned with the con, but indeed if somehow you handled the input outside of the velocity you could avoid this altogether. Sounds like a great idea.

    Yea I've been playing this game as well :)
    That's basically the idea yes.
    Although maybe you could add the possibility to influence the jump. (Like with Quake 3's Jump pads where you can get pushed with shots during the jump trajectory or give a movement input to offset your landing location).
    But having the jump to target without any influences would be great already.

    Cool man, can't wait to see version 2!
     
    lightbug14 likes this.
  2. abandon_games

    abandon_games

    Joined:
    Sep 1, 2017
    Posts:
    38
    Hi Lightbug!

    Quick question - is there an appropriate way to make a character crouch via scripting?

    I have a scripted moment where I need to make the player character crouch, I was able to accomplish this by exposing
    NormalMovement
    's
    wantToCrouch
    property, but was wondering if there's a better way that wouldn't require modifying one of your scripts.

    Thanks!
     
  3. Vaeer

    Vaeer

    Joined:
    Feb 22, 2022
    Posts:
    8
    Wow, this is impressive. Will CCP be able to also rotate while maintaining gravity (for jumping purposes) to that moving vehicle only? To complicate things even more, I need such vehicle to be a rigidbody as well, affected by collisions, etc. So it will rotate upside-down violently (against gravity outside), stop, accelerate, and the character must stick even while jumping. I have a little gravity area onboard, but the momentum has to be synced with the ship at all times, like you said. But, even with the vehicle upside down.

    Yes, I finally implemented the trick you described, but as you said, "The issue here is that momentum might be affected in unexpected ways". So, do I understand correctly you plan to make it all work with physics synced in V2? When could we expect this version? I'd buy it ASAP as it could solve many issues.

    Now, totally optional idea: would you consider making a demo scene with a fully rigged character? I think that could prove to be a major selling factor for your controller if it had such an example.
    As for me, I'm not a new coder, just never did that before. So would probably need to invest maybe a few days to do some research first (wasn't a top priority for now), which delays testing if a controller is really suitable for production for this or that reason. Such things really save us a lot of time. And many other assets don't have it, so value goes up for you.
     
    hodgepodge2022 likes this.
  4. mGMM

    mGMM

    Joined:
    Apr 3, 2017
    Posts:
    6
    Any updates on V2?
     
  5. Bluelight413

    Bluelight413

    Joined:
    Feb 8, 2018
    Posts:
    8
    I've set up the Input System through the Input System Handler script, and now I'm trying to implement a multiplayer system by following this tutorial: https://www.monkeykidgc.com/2020/12/unity-multiplayer-create-a-multiplayer-game.html.

    With a Player Input object attached to the Actions object on my player hierarchy, and a Player Input Manager attached to an empty in the scene, I'm able to spawn multiple copies of a player prefab. With a regular character set up through the input system, this should cause each spawned player to be receiving input from a different controller. However, when I spawn in players, they all are accepting input only from the first controller or keyboard that connected.

    Could it have anything to do with the fact that the Input System Handler reads inputs from the inputActionsDictionary, or do I just have something set up wrong from the tutorial's technique?

    upload_2022-6-23_17-36-10.png

    upload_2022-6-23_17-37-18.png

    upload_2022-6-23_17-38-4.png
     
    Last edited: Jun 24, 2022
  6. nedhaljalali

    nedhaljalali

    Joined:
    Sep 14, 2017
    Posts:
    13
    Hi, I've bought your CCP asset, and first thing : Great job, it's awesome !!!
    every thing is working fine
    but if i use 2 avatar with photon multiplayer
    i get this error :
    ArgumentException: An item with the same key has already been added. Key: Camera


    i think the my problem is here please if you can help me ?
     
  7. shanemt

    shanemt

    Joined:
    Mar 5, 2014
    Posts:
    23
    The problem is that it's finding all of the InputAxes objects in the scene, and since you're doing multiplayer you likely have multiple sets. You'll need to some sort of filtering or change the way you acquire these references.
     
  8. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    447
    Quick question ... not so quick answer, sorry :oops:

    The quick and easy way to achieve this is by forcing the crouch action to true. However, this doesn't mean the crouch action will be performed since the state is responsible for that.
    Example:
    Code (CSharp):
    1.         public void Crouch()
    2.         {
    3.             CharacterActions actions = CharacterActions;
    4.             actions.crouch.value = true;
    5.             CharacterStateController.CharacterBrain.SetAction(actions); //it should be "SetActions" plural ... ups
    6.         }
    7.  
    8.         public void StandUp()
    9.         {
    10.             CharacterActions actions = CharacterActions;
    11.             actions.crouch.value = false;
    12.             CharacterStateController.CharacterBrain.SetAction(actions);
    13.         }
    14.  
    This is more or less what an AIBehaviour does. Like i said, this might not work because of the internal logic of the state (NormalMovement in this case).

    Probably the best way to do it is by putting the crouch code inside a public method and call that. This can be done for jumping, moving, etc.

    From NormalMovement.cs
    Code (CSharp):
    1.  
    2.             // ...
    3.             if (wantToCrouch)
    4.                 Crouch();
    5.             else
    6.                 StandUp();
    7.         }
    8.  
    9.         public void Crouch()
    10.         {
    11.             Vector3 targetSize = new Vector2(CharacterActor.DefaultBodySize.x, CharacterActor.DefaultBodySize.y * crouchParameters.heightRatio);
    12.             CharacterActor.SetBodySize(targetSize);
    13.             isCrouched = true;
    14.         }
    15.  
    16.         public void StandUp()
    17.         {
    18.             Vector3 targetSize = new Vector2(CharacterActor.DefaultBodySize.x, CharacterActor.DefaultBodySize.y);
    19.             bool validSize = CharacterActor.SetBodySize(targetSize);
    20.             if (validSize)
    21.                 isCrouched = false;
    22.         }
    23.  
    I would recommend to design all states like this. You can force the implementations of public methods by using interfaces (e.g. IMove, IJump, ICrouch, etc). In fact, this is more or less how v2 is gonna work. The only difference is that actions will be triggered by other scripts called "controllers" (the if (wantToCrouch) Crouch() statement won't be there).

    The tutorial is fine. Personally, I've never considered local multiplayer with this system before so this is kinda new to me.

    CCP's input handler does read directly from a dictionary. However, the dictionary its private and belongs to each input handler. Since ReadValue only cares about the action state, it is necessary to filter those actions first. That's way there is a filterByActionMap and filterByControlScheme fields. However, that's not enough since there is no way to know from which device the input came from.

    From the input-system documentation:
    "Device assignments:
    Each PlayerInput can have one or more Devices assigned to it. By default, no two PlayerInput components are assigned the same Devices, but you can force this; to do so, manually assign Devices to a player when calling PlayerInput.Instantiate, or call InputUser.PerformPairingWithDevice on the InputUser of a PlayerInput.
    If the PlayerInput component has any Devices assigned, it matches these to the Control Schemes in the associated Action Asset, and only enables Control Schemes which match its Input Devices."


    So each "Player" has a set of devices, this is key. Everytime a player is instantiated, a device is paired to it.
    I guess i'm gonna need to define a set of devices for each input handler somehow. Another alternative could be implementing a PlayerInput-based handler.


    Thank you!

    What shanemt said. Normally, the first thing you need to do is to bypass all the local player code (and components associated) for all clients that aren't local. That way you could prevent multiple cameras, multiple human brains, multiple UIs, and so on.
     
    Bluelight413 and abandon_games like this.
  9. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    447
    Imagine a virtual point in space where the character is. Now move/rotate that point based on the vehicle movement/rotation. That's where the character is going to be at the end of the simulation. The idea is to allow you to tweak how much of that rotation will be applied. For example, if the vehicle does 30° of yaw and 50° of pitch, then you can choose what to apply to the body and what to ignore.

    There's no difference, the logic applies to any type of Rigidbody.

    I might upload this before v2.

    Do you mean a rigged character like the one from the 3D Scene? the "magenta/purple guy"?
     
  10. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    447
    The only thing i can share right now is the new (hopefully) improved "controller" system.
    The big change is that behaviour-based scripts (a.k.a "states" in v1) won't be responsable of reading and implementing actions directly anymore. Instead, these behaviours will only contain the action functionality, so they can be called at any time. The components responsible for making those calls are known as "controllers" (e.g. PlayerController and AIController).

    upload_2022-8-20_16-47-25.png
    This is the "recommended" structure to follow, a guideline if you want.

    Here is a very raw example of this in action.
    1. First, you define an action via an interface, like for example IMove:
    Code (CSharp):
    1. public interface IMove
    2. {
    3.     void Stop();
    4.     void Move(Vector3 direction);
    5.     void MoveTo(Vector3 destination);
    6. }
    2. Next, you implement that interface/action inside your "behaviour" component (e.g. Locomotion state):

    Locomotion.cs
    Code (CSharp):
    1. public class Locomotion : CharacterState, IMove, IRun, IJump, ICrouch, IDash, IInteract
    2. {
    3.     // ...
    4.     #region IMove
    5.     public void Stop()
    6.     {
    7.         CharacterActor.AcceleratePlanarWithPhysics(Vector3.zero, acceleration);
    8.     }
    9.  
    10.     public void Move(Vector3 direction)
    11.     {
    12.         movementDirection = Vector3.ProjectOnPlane(direction, CharacterActor.Up).normalized;
    13.         CharacterActor.AcceleratePlanarWithPhysics(movementDirection * baseSpeed, acceleration);
    14.     }
    15.  
    16.     public void MoveTo(Vector3 destination)
    17.     {
    18.         Vector3 direction = Vector3.Normalize(destination - CharacterActor.Position);
    19.         Move(direction);
    20.     }
    21.     #endregion
    22. }
    3. Finally, you implement a "controller" that handle those calls:
    ExamplePlayerController.cs
    Code (CSharp):
    1. void FixedUpdate()
    2. {
    3.     Vector3 movementDirection = GetMovementInputDirection(_movement.Value);
    4.  
    5.     ProcessMovement(movementDirection);
    6.     ProcessCrouch();
    7.     ProcessJump();
    8.     // ...
    9. }
    10.  
    11. void ProcessMovement(Vector3 movementDirection)
    12. {
    13.     if (movementInput.Detected)
    14.         move?.Move(movementDirection);
    15.     else
    16.         move?.Stop();
    17. }
    18.  
    19. void ProcessCrouch()
    20. {
    21.     if (crouchInput.Started)
    22.         crouch?.StartCrouch();
    23.     else
    24.         crouch?.CancelCrouch();
    25. }
    26.  
    27. void ProcessJump()
    28. {
    29.     if (jumpInput.Started)
    30.         jump?.StartJump();
    31.     else if (jumpInput.Canceled)
    32.         jump?.CancelJump();
    33. }
    34.  
    35. // ...

    Notice that i'm using CCP's input action system, although you don't need to. You could use Unity's Input System directly, or even the PlayerInput component and everything should work fine.

    Also notice that actions could be much more complex in comparison with v1. For instance, IJump is defined like this:
    Code (CSharp):
    1. public interface IJump
    2. {
    3.     void StartJump();
    4.     void CancelJump();
    5.     void PerformFullJump();
    6.     void PerformShortJump();
    7.     void JumpTo(Vector3 target);
    8. }
    An NPC controller (e.g. a behaviour tree) might have access to more complex actions, whereas a PlayerController might use only one or two of those actions. Naturally, the device the player is using with limit the number of actions he/she can access to.
    In my opinion this system is cleaner than the old system.
     
    Arthur-A and mGMM like this.
  11. auvalice

    auvalice

    Joined:
    Jul 27, 2021
    Posts:
    1
    Small circumstantial bug;
    • Fresh project, create a CharacterActions asset, do not add an input to one of the categories, press Generate, an exception is thrown because one of the three arrays is null
    • Add the missing field, generate, everything is OK
    • Remove that field, generate, it gets generated although compiler will complain that the field that was previously there is now missing from CharacterActions.cs. Thought maybe the asset now contains an empty array instead of being null?
    • Create a new CharacterActions asset, generate with one empty category, generated with same caveat as above.
    • Add missing field again, it's fine again.
    Minor impact, solution is just adding a dummy field to the empty category.
     
  12. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    447
    Hi @auvalice, thank you for reporting this issue :)
    Indeed, there was a missing "empty-check" for those strings.
    This is what appears in the console if you leave one of those elements empty:
    IndexOutOfRangeException: Index was outside the bounds of the array.

    The fix (CharacterActionsAssetEditor.cs):
    Code (CSharp):
    1. string GenerateOutput(string className, string templatePath)
    2. {
    3.     for (int i = 0; i < boolActions.arraySize; i++)
    4.     {
    5.         string actionName = boolActions.GetArrayElementAtIndex(i).stringValue;
    6.         if (actionName.IsNullOrEmpty())  //<----
    7.             continue;
    8.  
    9.         ...
    10.     }
    11.  
    12.     for (int i = 0; i < floatActions.arraySize; i++)
    13.     {
    14.         string actionName = floatActions.GetArrayElementAtIndex(i).stringValue;
    15.         if (actionName.IsNullOrEmpty()) //<----
    16.             continue;
    17.  
    18.         ...
    19.     }
    20.  
    21.     for (int i = 0; i < vector2Actions.arraySize; i++)
    22.     {
    23.         string actionName = vector2Actions.GetArrayElementAtIndex(i).stringValue;
    24.         if (actionName.IsNullOrEmpty()) //<----
    25.             continue;
    26.  
    27.         ...
    28.     }
    29.     ...
    30.     return output;
    31. }
    This fixes one problem, although i'm not sure it is the one you reported.

    I couldn't reproduce this :(... Could you describe your fresh project?

    The actions array itself should't be null since, by making it serializable, Unity creates a zero length array for it (e.g.boolActions = new string[0]).
     
  13. nedhaljalali

    nedhaljalali

    Joined:
    Sep 14, 2017
    Posts:
    13
    thank you it is working great now .. :)
     
    lightbug14 likes this.
  14. TRuoss

    TRuoss

    Joined:
    Dec 5, 2012
    Posts:
    85
    Hi @lightbug14 first of all thanks for your asset, I appreciate that you share your knowledge with us.

    I stumbled across this section of the code in the PhysicsActor.cs and I´m a bit confused why you use Time.deltaTime and not Time.fixedDeltaTime.

    Code (CSharp):
    1. void FixedUpdate()
    2.         {
    3.             if (UseRootMotion)
    4.                 return;
    5.  
    6.             float dt = Time.deltaTime;
    7.  
    8.             PreSimulationUpdate(dt);
    9.             OnPreSimulation?.Invoke(dt);
    10.  
    11.             // 2D Physics (Box2D) requires transform.forward to be Vector3.forward/back, otherwise the simulation will ignore
    12.             // the body due to the thinness of it.
    13.             if (Is2D)
    14.             {
    15.                 if (Right.z > 0f)
    16.                     Right = Vector3.forward;
    17.                 else
    18.                     Right = Vector3.back;
    19.             }
    20.  
    21.             // Manual sync in case the Transform component is "dirty".
    22.             transform.position = Position;
    23.             transform.rotation = Rotation;          
    24.         }
    25.  
    26.         IEnumerator PostSimulationUpdate()
    27.         {
    28.             YieldInstruction waitForFixedUpdate = new WaitForFixedUpdate();
    29.             while (true)
    30.             {
    31.                 yield return waitForFixedUpdate;
    32.  
    33.                 float dt = Time.deltaTime;
    34.  
    35.                 if (enabled)
    36.                 {
    37.                     PostSimulationUpdate(dt);
    38.                     OnPostSimulation?.Invoke(dt);
    39.                     UpdateInterpolationTargets();
    40.                 }
    41.  
    42.             }
    43.         }
     
    lightbug14 likes this.
  15. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    798
    lightbug14 likes this.
  16. TRuoss

    TRuoss

    Joined:
    Dec 5, 2012
    Posts:
    85
    flashframe likes this.
  17. RonGur

    RonGur

    Joined:
    Oct 30, 2018
    Posts:
    1
    H :) can someone please explain to me how do I make the character climb over lesges automatically? without jumping before?
     
  18. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    447
    Hi,

    Are you referring to the LedgeHanging component? If so, try to enable "grounded detection" from the inspector. Remember to tweak the rays length/position until the ledge can be detected by the character.
     
  19. HustlaMasi

    HustlaMasi

    Joined:
    Aug 17, 2017
    Posts:
    4
    Hey hey,
    I want to make a first-person controller, but every time the actor is near the ground it immediately teleports/snaps to the bottom.

    Is there a way/option so its not doing that?
    Enabling "AlwaysNotGrounded" fixes it but that's not really a solution I guess
     
  20. partridge

    partridge

    Joined:
    Dec 8, 2014
    Posts:
    7
    Hi @lightbug14,

    I'm trying to implement multiplayer with clients sending CharacterActions to the server. The server then sends out those actions to clients for them to simulate. Sometimes the position gets a bit out of sync (I think this is inevitable since the network ticks are fewer than fixed update ticks), so I need a method of syncing up the remote players on a given client when they are out of position by a certain amount.

    I've tried setting
    CharacterStateController.CharacterActor.Position
    but it ends up being very jittery. I've also tried using
    CharacterStateController.CharacterActor.Velocity
    but with this it is hard to figure out the amount of velocity to apply.

    I'm using a modified version of your NormalMovement - is there a good point in the processing in here where I could incorporate small position corrections coming from network updates?

    Thanks!
     
  21. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    447
    Hi @HustlaMasi,

    That happens because of the GroundCheckDistance constant. I guess you could try to reduce it and see what happens.
    Normally, this shouldn't be noticeable at normal speed. Regardless, i will try to improve this if possible. Thanks for reporting it.

    Hi @partridge.

    How would you describe that jitter? Very random? Interpolation issues?
    In any case, setting the Position property shouldn't break interpolation.

    When do those network ticks occur?

    Have you tried to set the velocity based on the target position? For example:
    vel = (targetPos - currentPos) / dt

    You could use:
    - (Pre/Post)UpdateBehaviour, which is equivalent to FixedUpdate (before CharacterActor's FU)
    - PreCharacterSimulation: right after CharacterActor's FU
    - PostCharacterSimulation: after the physics simulation (and after CharacterActor's PostSimulationUpdate)
     
  22. partridge

    partridge

    Joined:
    Dec 8, 2014
    Posts:
    7
    Thanks for your reply @lightbug14.
    Here's a vid showing the issue. The first player to move is the regular local one, the second is the remote one that is having it's position explicitly set when the difference is 0.1 magnitude out from what it should be.

    As you can see the second player is jumping slightly when moving. Seems random-ish, but that could be due to using the magnitude as a tolerance. Setting position feels like it's probably the wrong thing to do since it is shifting the player instantaneously, and in the network world that remote position is probably already out of date (compared to velocity generated by processing the remote CharacterActions).
    I initially thought the network updates would be less frequent than the frames but after doing some debugging it appeared that there were updates coming into that client multiple times per frame. I have the client and server running on the same machine and the client may have been running at a higher framerate than the server (running thru Unity IDE). From what I've read the network processing in Mirror is all done after LateUpdate (which I thought would mean that it's frame dependant, but maybe you can get several network updates arriving in the queue between a frame). Anyway, bottom line, I can't guarantee when updates are going to come in, they may be several times per frame or less than 1 per frame (latter prob more likely in proper remote latency scenarios).
    With updating the velocity I was doing the following admittedly naïve method :
    Code (CSharp):
    1.              
    2. Vector3 diff = remoteCharacterActions.position - transform.position;
    3. float speed = 0.2f * Mathf.Clamp(diff.magnitude, 3f,5f);
    4. var velocity = (remoteCharacterActions.position - normalMovement.CharacterStateController.CharacterActor.Position).normalized * speed;
    5. normalMovement.CharacterStateController.CharacterActor.Velocity += velocity;
    I was trying to use magnitude of the difference in the calculation but it wasn't working so well (hence the Clamp in there). I'm doing += to the current velocity because the correction has to happen as well as still processing the CharacterActions (I'm setting this to a AIBehaviour btw). I wasn't using delta-time because the network behaviour receiving remote updates is a separate class from NormalMovement. It does have a reference to it though so I'm sure I can make that happen.

    Given that Mirror processing is done after LateUpdate, does that change where you suggest I should put the velocity change? Given LateUpdate is after everything, maybe it should at the earliest point in the next frame?
     
  23. jmaldonado93

    jmaldonado93

    Joined:
    Oct 19, 2013
    Posts:
    89
    Hello @lightbug14

    I am using character controller pro for a 2D game. In the demo 2d scene, I added a few AI character examples and I see that the human player ignores the rigidbody and collider from an AI character when passing through it (which is exactly what I want).

    However, when I test this on my scene, the human and the AI collide and I cannot pass through it. After doing some tests, I found out that this only happens when I am standing on ground set as a tilemap, and since I am using composite collider on my tilemaps, a Rigidbody is automatically added to it, meaning that the collision between the characters happen because of the rigidbody on the ground. Also, the push behavior does not work either whenever the object I want to push is in the tilemap ground containing the rigidbody.

    Is there a way I can fix this? I would not want to remove the composite collider from my tilemap because it enhances the fps a lot. I tried using the collision matrix but this does not work.

    Below is a screenshot of the components of the tilemap.

    upload_2023-2-16_12-21-12.png

    Thanks in advance
     
  24. supervaughanbros

    supervaughanbros

    Joined:
    Oct 24, 2018
    Posts:
    1
    Using CCP, I was messing with rigidbodies and the push dynamic rigidbodies function and I find it's really easy to force objects outside the geometry via physics glitches, when I make the object much larger and increase it's mass it's unlikely to go outside the geometry but also they player seems to "phase though it" by slowly moving into the object like it's made of jello, only being pushed out when you let go of a movement key or stop moving towards it. Any solutions to this? I imagine I could selectively enable/disable allowing the player to push rigidbodies if they can't be pushed further but I have no idea how to track that. I'm leaning towards just adding a system to let the player pick up and move things by selecting them and disallowing pushing by moving at all.
     
  25. maneku

    maneku

    Joined:
    Jun 4, 2017
    Posts:
    5
    Hello, I try to use CCP for ai characters but my player character intersect with ai character. Is there anything to prevent this behaviour?

    collision.gif
     
  26. davidrochin

    davidrochin

    Joined:
    Dec 17, 2015
    Posts:
    72
    How would I go about completely disabling and enabling the CPP at runtime, without removing/adding components? I want to do some fully scripted movement (updating transform.position), but the controllers components seem to be getting in the way.

    Or at least, I would need a way to update transform.position from Update. None of the things I've done worked so far.

    Things I've tried:

    transform.position = position

    rigidbody.MovePosition(position)

    characterActor.Move(position)


    All of that after adoing
    Code (CSharp):
    1. _actor.IsKinematic = true
    None of them do nothing
     
  27. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    447
    Hi @supervaughanbros and @maneku

    Thanks for reporting this!
    The good news is that i think this is fixed in 1.4.5 (should be available now). Please, test that version and let me know if you experience the same issues.

    @maneku You could make the player character ignore those AI characters in the same way you could make it ignore any rigidbody in the scene. Check the "pushable rigidbody layer mask" in the inspector.
    I might add this functionality, just for character-v-character interactions.

    Hi @davidrochin
    It is true that the controller doesn't let you change those components and for a good reason. For instance, changing the transform could break interpolation easily, and possibly the dynamic ground movement as well.
    Low level components such as Transform and Rigidbody are now fully controlled by the actor when certain features are enabled. This is why you should always ask the CharacterActor to do X task.

    That being said, you can always ignore the CharacterActor features by disabling the component.
    Code (CSharp):
    1. CharacterActor.enabled = false;
    This should allow you to move without issues.
    The actor will also move if you disable interpolation:
    Code (CSharp):
    1. CharacterActor.interpolateActor = false;
    With this, you should be able to use rigidbody.position, transform.position, rigidbody.MovePosition, etc.
    One last thing, MovePosition uses Unity's interpolation, so don't expect interpolated movement unless you enable "interpolation" from the Rigidbody component. Since CCP uses its own interpolation, Unity's interpolation is disabled by default.
     
    Last edited: Mar 14, 2023
    davidrochin likes this.
  28. takaraemisaito1994

    takaraemisaito1994

    Joined:
    Dec 26, 2021
    Posts:
    7
    Hey question! I am deciding if I should get this or not. The current character controller I'm using has analog movement. Meaning depending on the pressure of the gamepad stick, the character would move slowly or fast with movespeed. Is there a way I can manipulate movespeed on the character controller for analog movement?
     
  29. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    798
    The asset already works like that by default. And very easy to modify to interpret input however you want.
     
  30. takaraemisaito1994

    takaraemisaito1994

    Joined:
    Dec 26, 2021
    Posts:
    7

    Thanks! Well.. I'm sold!
     
  31. takaraemisaito1994

    takaraemisaito1994

    Joined:
    Dec 26, 2021
    Posts:
    7
    So I brought the asset and I'm having major problems. I'm trying to replace my previous character controller with this but I ran into some problems:

    1. I want to keep the Animation Controller I have. So I need to use those animations with the controller. My solution to this was keeping my original script and just add the actions onto it. I also found out about Character Actions. I had an major error with this, so I had to reimport the whole package for it to work (This is all my fault as I didn't read the warnings on your guide page(.
    2. I want to use the new Unity Input System and the controls I already have. When I tried fixing into it, nothing worked.
    3. I would really like someone's help to go into detail on how to use this. The guide doesn't really help, and there's basically no tutorials on how to set it up besides the one tutorial with the "set up" process which is only importing the project and that's it.


    Please help!!
     
  32. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    798

    Did you read the page in the manual about using the new Unity Input System? there's a script there to make a custom Input Handler:

    https://lightbug14.gitbook.io/ccp/how-to.../implementation/actions/use-the-new-input-system
     
  33. takaraemisaito1994

    takaraemisaito1994

    Joined:
    Dec 26, 2021
    Posts:
    7
  34. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    798
  35. takaraemisaito1994

    takaraemisaito1994

    Joined:
    Dec 26, 2021
    Posts:
    7
  36. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    798
    I'm not the author of the asset - you're probably best contacting them directly. There's an email address on the store page, or you could try direct messaging them on here.

    Good luck!
     
  37. artfabrique

    artfabrique

    Joined:
    Nov 8, 2012
    Posts:
    25
    Hi! Just bought your Character Controller Pro!
    First of all - really good code quality and thank you!
    A question:
    Is there a way to achieve character sliding along curve on contact? Imagine grinding on rails on skateboard: You can jump on a path and you can jump out from path. I was thinking of generating mesh colliders like 0 height stripes but i can not figure out an approach using CCP to fixate char on rail preserving velocity projection to the path of rail + maybe some boost from physics material or something like that.
    Not asking for implementation but just combo of CCP parts that might get me 80% there.
     
  38. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    326
    Can you add floor sliding?
     
  39. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    326
    Multiplayer like fishnet or unity official networking?
     
  40. ZerglebReal

    ZerglebReal

    Joined:
    Apr 27, 2021
    Posts:
    7
    I don't know the right place to add suggestions. You know best how the platform code works and I was wondering if you could add the ability to ledge hang on moving platforms. Right now it does catch the platform but when the ledge moves the player does not move with the platform and simply crawls up on to a ghost platform and falls to the ground. Thank you for reading, this would be very helpful.
     
  41. scorp2007

    scorp2007

    Joined:
    Aug 17, 2014
    Posts:
    54
    how can i change HumanInputType from script? Let's say if I need to define the system and switch the control system depending on whether it is mobile or PC?
     
  42. lllEvo

    lllEvo

    Joined:
    Aug 3, 2020
    Posts:
    1
    Hi, quick simple question regarding optimization. I used your character controller pro extensively for the player and enemy AI, I have implemented some of my own behaviors and stuff to the AI, that aside, when I duplicate the enemy AI, say 50 to 100 units active it's taking a chunk of my framerates like 3-5 fps per unit.

    FYI i am using Unity 2019
    The profiler has shown me that FixedBehaviourUpdate and FixedUpdate has the highest system usage, I made sure that the AI is doing nothing behaviour-related. If i've mistaken the cause then my apologies on my behalf.

    I wanted to know, where should I focus on optimizing? I am using an older version and quite prone to updates. If you could suggest an area or script I should look at would be of great help, thanks!
     
  43. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223
    Light bug are u here? Is this asset abandoned? I’ve emailed you a few times to no response. I wanted to know how I can rotate the character using the second joystick (like a dual stick shooter)

    My next quest was if you were still supporting this asset….
     
  44. fbmd

    fbmd

    Joined:
    Dec 4, 2016
    Posts:
    16
    I would also like to know if this cool asset is still supported?
     
  45. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223
    i think he abandoned it. he's not answer his emails either and hes usually quick about answering. or hes on vacation or something.
     
  46. Traxyte

    Traxyte

    Joined:
    Oct 29, 2019
    Posts:
    5
    Hi guys. Does anyone know, how to implement headbobbing effect to Camera 3D?
     
  47. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    116
    Too bad, I'm stuck with this asset. I hope I'll manage even if it is unsupported now.