admin管理员组

文章数量:1357281

I was looking to have speeds changed at runtime, and the SetKinematicSpeed function appears to do nothing. The motion is constant even if set to 0. In every frame, the value before calling SetKinematicSpeed is reset to the asset value (default 8), even if it shows as 0 after the call. I also didn't see anything in the KCC Addon manual about changing speeds.

FPVector2 moveVec = tgt - tf->Position.XZ;
kcc->SetKinematicSpeed(FP._0);
kcc->SetInputDirection(moveVec.XOY);

I could potentially find the settings asset and update that, but it seems like there should be a better way.

frame.FindAsset(filter.KCharController->Settings).Processors... -> EnvironmentProcessor -> KinematicSpeed = s;

Let me know if you have any ideas, thanks!

I was looking to have speeds changed at runtime, and the SetKinematicSpeed function appears to do nothing. The motion is constant even if set to 0. In every frame, the value before calling SetKinematicSpeed is reset to the asset value (default 8), even if it shows as 0 after the call. I also didn't see anything in the KCC Addon manual about changing speeds.

FPVector2 moveVec = tgt - tf->Position.XZ;
kcc->SetKinematicSpeed(FP._0);
kcc->SetInputDirection(moveVec.XOY);

I could potentially find the settings asset and update that, but it seems like there should be a better way.

frame.FindAsset(filter.KCharController->Settings).Processors... -> EnvironmentProcessor -> KinematicSpeed = s;

Let me know if you have any ideas, thanks!

Share Improve this question asked Mar 29 at 17:31 Brayden RudisillBrayden Rudisill 131 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Support got back to me with this response, sharing in case it helps~

Hi, assuming this is Quantum KCC related (we also have KCC for Fusion). So when KCC runs its update, it internally executes methods on processors (such as EnvironmentProcessor) before and after move. Because EnvironmentProcessors overrides the KinematicVelocity, calling KCC.SetKinematicVelocity() before KCC updates doesn't have any impact. You need to:

  1. Remove EnvironmentProcessor and handle Gravity/KinematicVelocity/Jumping/... on your own using the KCC.SetKinematicVelocity() before KCC updates.

  2. [Recommended] Create a copy of EnvironmentProcessor and modify it - so for example instead of a EnvironmentProcessor speed property you get your custom component which holds the speed and is on the KCC entity.

  3. Add custom processor which overrides the velocity.

Be careful with changing EnvironmentProcessor properties (just don't do that :) ) because these are not part of the Quantum state and don't support rollback, you can easily get a desync.

本文标签: photonChanging KCC speed at runtimeStack Overflow