3D角色controller骑行平台团结?

发布于 2025-02-07 22:38:34 字数 1063 浏览 2 评论 0原文

我有一个播放器控制器脚本我正在编写使用targionController component 来移动和处理碰撞。除了移动平台,我基本上能够基本实现我想要的的所有功能。

有些要注意的事情:

- 为了测试目的,平台通过update()函数移动,并且没有argid> argidbody component 附在上面。我认为僵化的人首先不会有所作为,但我可能是错的。

- 目前,当我的播放器站在平台上时, 会做应该做的事情,但是它会以大量的抖动移动。,换句话说,玩家无法像平台移动一样快地依靠自身,因此会导致抖动。

这是我尝试的:

我最初的想法是在移动平台上创建一个脚本,以跟踪其自身速度。 (...)函数,我将获得平台的速度,并将其添加到玩家的速度中。 这引起了与以前相同的抖动效果。

我的下一个想法是每当玩家碰撞时,播放器将播放器送往平台。该解决方案也不起作用,因为显然targincontroller s当他们是移动对象的孩子时不喜欢它。平台的转换对播放器几乎没有影响,不管它的速度如何。因此,的抖动继续。

只是为了测试可能的解决方案,我还尝试将上一个修复程序结合起来,但我们中间的抖动生活仍然存在。

结束思想:

我开始认为这不是完全可能的,但是我仍然抱有希望。我也宁愿不购买现有资产或切换到刚性机体组件,因为这都不适合我的游戏样式。

请随时提问以获取更多详细信息,并提前感谢您!

**编辑** 这个问题已移至gamedev.stackexchange.com

I have a player controller script that I'm writing that uses the CharacterController component to move around and handle collisions. I've been able to implement basically every feature that I want except for moving platforms.

Some things to note:

-For testing purposes, the platform moves via the Update() function and does not have a Rigidbody component attached to it. I don't think that rigidbodies would make a difference in the first place, but I could be wrong.

-Currently, when my player stands on the platform, it kind of does what it's supposed to do, but it moves with a large amount of jitter. In other words, the player isn't able to depenetrate itself as fast as the platform moves, therefore causing the jitter.

Here's what I've tried:

My initial thought was to create a script on the moving platform that keeps track of its own velocity. Then, on the player's OnControllerColliderHit(...) function, I would get the platform's velocity and add it to the player's velocity. This caused the same jittery effect as before.

My next idea was to parent the player to the platform whenever the player collided with it. This solution also did not work because apparently CharacterControllers do NOT like it when they are a child of a moving object. The platform's transformations had little to no effect on the player, regardless of its speed. So once again, the jitteriness continued.

Just to test out possible solutions, I also tried combining the two previous fixes and still, the jitteriness lives among us.

Closing thoughts:

I'm beginning to think that it's not entirely possible, but I'm still holding out hope. I would also prefer to not to purchase an existing asset or switch to a Rigidbody component because neither would fit the style of my game.

Feel free to ask questions for more details and thank you in advance!

**EDIT**
THIS QUESTION HAS BEEN MOVED TO GAMEDEV.STACKEXCHANGE.COM

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文