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 badges1 Answer
Reset to default 0Support 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:
Remove EnvironmentProcessor and handle Gravity/KinematicVelocity/Jumping/... on your own using the KCC.SetKinematicVelocity() before KCC updates.
[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.
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
版权声明:本文标题:photon - Changing KCC speed at runtime - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744009257a2575261.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论