Adventure Movement turn in place

MarkusKer

Member
Hello,

i am using the adventure movement on a small space. My current problematic is, that the adventure movements standard behavior for turning into another direction is: the character is taking a small turn with an radius. The combat movement type is turning right on the spot. Is there a way i can make the adventure movement also turn on one spot without the character walking the radius. The problem is that if i have a wall behind the character and i change direction it tends to bump into it due to this behavior.

Regards,
Markus
 

Andrew

Moderator
Staff member
Hi, have you tried increasing the character's rotation speed? It's in the UltimateCharacterLocomotion component, under "Motor":
1598440115856.png
 

MarkusKer

Member
Hello, yes i have tried that but sadly that does not change the behavior. Is there anything else i could try.
 
Last edited:

MarkusKer

Member
If i am crouching, changing the rotation speed does help. Is there an difference between those states causing it to work somehow?
 

Andrew

Moderator
Staff member
Apologies for missing this.

Could you try reproducing this within the demo scene? I just tested it and increasing the Motor Rotation Speed on Nolan works fine. Having the crouch ability active shouldn't affect anything, unless you've set up any state presets that might be interfering with the motor rotation.
 

MarkusKer

Member
Thank you,

the quick turn ability was causing the problem.
If i now increase the Motor Rotation Speed the player turns faster and the undesired behavior is less appearing. But the initial problem is not quiet solved with this. the player still takes a small radius to turn and it looks kind of rediculous if the rotation speed is very high.

Regards,
Markus
 

Andrew

Moderator
Staff member
If you want the character to literally just rotate on the spot, then I think you'll need to create a custom movement type that prevents movement whilst rotating. It shouldn't require much additional code since you're changing a pretty simple aspect of the character movement. This page describes the basics of how to create a custom movement type and provides some example code:

 

MarkusKer

Member
Hello, i have followed the documentation carefully and was able to create a new movement type. but if i hit play another movement type gets selected automatically. i only have this behavior with my custom movement. For testing i am only using the provided example code from the documentation.
 

Andrew

Moderator
Staff member
Are you testing this in the demo scene? The demo manager automatically sets the character's movement type in Awake.
 

MarkusKer

Member
Yes i was, but i tried it with the manager beeing disabled and it was the same behavior. However if i check one of the included movement types they stay selected. Only my added one gets deselected.

This is my Movement code:

using Opsive.Shared.Events;
using Opsive.UltimateCharacterController.Character.MovementTypes;
using Opsive.UltimateCharacterController.Character.Abilities.Items;
using Opsive.UltimateCharacterController.Utility;
using UnityEngine;



public class MyMovementType : MovementType
{
public override bool FirstPersonPerspective { get { return false; } }

public override float GetDeltaYawRotation(float characterHorizontalMovement, float characterForwardMovement, float cameraHorizontalMovement, float cameraVerticalMovement)
{
return 0;
}

public override Vector2 GetInputVector(Vector2 inputVector)
{
return inputVector;
}
}
 

Andrew

Moderator
Staff member
I can't reproduce this issue in the demo scene at all... can you try it in a fresh project/scene? (Also what version of UCC/Unity are you on?)
 

MarkusKer

Member
It looks like the camera controller was causing the problem. if i have the camera view type"Adventure" active the characters movement type changed aswell. I got around this issue by creating a new view type calling it like my new movement type.
 
Top