8.1
使用fiexed joint实现人物抓取物体效果(点击右手抓取键位时,从角色右侧发射出一定距离长度的射线,击中可移动的物体则与角色的右手创建关节连接,松开时解除连接。左手抓取则为反方向的射线判断)为避免碰撞,在抓起物体时将物体的collider设置为isTrigger,松开时再关闭。
Using fixed joint to implement the character grabbing objects effect (when the right-hand grab key is pressed, a raycast of a certain distance is fired from the character's right side. If it hits a movable object, a joint connection is created between the object and the character's right hand, which is released when the key is released. Left-hand grabbing uses a raycast in the opposite direction). To avoid collisions, when an object is grabbed, its collider is set to isTrigger, and then disabled when released.
调整地面检测,之前是用碰撞检测+筛选tag的方式的,比较不准确。尝试使用球形射线检测,没有完全做完。
之前跳跃cd有bug所以没做,改地面检测的时候发现了问题,把跳跃cd加上了。
Adjusted ground detection. Previously used collision detection + tag filtering method, which was not very accurate. Attempted to use spherical raycast detection, but didn't fully complete it.
Previously didn't implement jump CD because it had a bug. When fixing ground detection, discovered the problem and added the jump CD.
8.2
地面检测基本准确,当角色离地面大概半只脚以上厚度的距离就判断为离地。但是很多时候射线会撞到绳子上而误判断为地面,将绳子设置为反转遮罩层,修复了问题。
之前在跳跃前会给角色加速以跳的够远,现在加了cd之后。因为游戏更新原因,速度调整会有问题。调整协程的位置,添加开始跳跃的flag并在行走速度计算中添加判断,都没办法解决(时好时坏),此问题暂时搁置。
偶尔会没有问题(跳跃有前冲力):
Ground detection is now basically accurate. When the character is approximately half a foot or more above the ground, it's judged as being off the ground. However, the raycast often hit the rope and incorrectly detected it as ground. Set the rope to an inverted layer mask, which fixed the problem.
Previously, before jumping, the character would be accelerated to jump far enough. Now after adding the CD, due to game update reasons, speed adjustment has issues. Tried adjusting the coroutine position and adding a jump start flag with checks in the walking speed calculation, but none of these could solve it (works sometimes, fails other times). This problem is temporarily shelved.
Sometimes there's no problem (jump has forward momentum):
有时候会有问题(跳跃无前冲力,可能是被行走速度覆盖):