yura8822 / ECS_PathFinding

Unity 2021.2.0f1
1 stars 1 forks source link

This is a good project, but I noticed that some objects are floating and stacking up after reaching their position. I don't know how to solve this problem. #1

Open oshellhahaha opened 1 year ago

oshellhahaha commented 1 year ago

image

yura8822 commented 1 year ago

Try uncommenting "//mass.InverseInertia[1]" in FreezeverticalRotationSystem (freeze position) In prefab change physics shape to BOX

P.S. But the best solution would be to implement a system that focuses on the speed of the character. If the character is standing still, then do not apply the movement force to him.

вт, 16 мая 2023 г. в 16:22, oshellhahaha @.***>:

[image: image] https://user-images.githubusercontent.com/30201320/238656865-4022161e-e489-4dd5-9c65-9c3056e13d32.png

— Reply to this email directly, view it on GitHub https://github.com/yura8822/ECS_PathFinding/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZ5MN7774EKZRINSP5EN2LXGN5SRANCNFSM6AAAAAAYDUZURA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

yura8822 commented 1 year ago

Source: https://www.youtube.com/watch?v=1bO1FdEThnU&list=PLmRTcTRr9f_NHg1xigLp2mb2uSCLL407c&index=20&t=9s&ab_channel=CodeMonkey https://www.youtube.com/watch?v=ubUPVu_DeVk&list=PLmRTcTRr9f_NHg1xigLp2mb2uSCLL407c&index=19&t=1629s&ab_channel=CodeMonkey

вт, 16 мая 2023 г. в 17:42, yura88 Yura88 @.***>:

Try uncommenting "//mass.InverseInertia[1]" in FreezeverticalRotationSystem (freeze position) In prefab change physics shape to BOX

P.S. But the best solution would be to implement a system that focuses on the speed of the character. If the character is standing still, then do not apply the movement force to him.

вт, 16 мая 2023 г. в 16:22, oshellhahaha @.***>:

[image: image] https://user-images.githubusercontent.com/30201320/238656865-4022161e-e489-4dd5-9c65-9c3056e13d32.png

— Reply to this email directly, view it on GitHub https://github.com/yura8822/ECS_PathFinding/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZ5MN7774EKZRINSP5EN2LXGN5SRANCNFSM6AAAAAAYDUZURA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

oshellhahaha commented 1 year ago

资料来源: https://www.youtube.com/watch ?v=1bO1FdEThnU&list=PLmRTcTRr9f_NHg1xigLp2mb2uSCLL407c&index=20&t=9s&ab_channel=CodeMonkey https://www.youtube.com/watch?v=ubUPVu_DeVk&list=PLmRTcTRr9f_NHg1xigLp2mb2uSCLL40 7c&index=19&t=1629s&ab_channel=CodeMonkey вт, 2023 年 16 月 4 日。17:42,yura88 Yura88 @.>: …… Try uncommenting "//mass.InverseInertia[1]" in FreezeverticalRotationSystem (freeze position) In prefab change physics shape to BOX P.S. But the best solution would be to implement a system that focuses on the speed of the character. If the character is standing still, then do not apply the movement force to him. вт, 16 мая 2023 г. в 16:22, oshellhahaha @.>: > [image: image] > https://user-images.githubusercontent.com/30201320/238656865-4022161e-e489-4dd5-9c65-9c3056e13d32.png > > — > Reply to this email directly, view it on GitHub > <#1>, or unsubscribe > https://github.com/notifications/unsubscribe-auth/AKZ5MN7774EKZRINSP5EN2LXGN5SRANCNFSM6AAAAAAYDUZURA > . > You are receiving this because you are subscribed to this thread.Message > ID: @.***> >

Thank you, I just started learning Unity ECS recently.

yura8822 commented 1 year ago

Please note, the current version of DOTS is 1.0. It is very different from 0.51.

вт, 16 мая 2023 г. в 17:56, oshellhahaha @.***>:

资料来源: https://www.youtube.com/watch ?v=1bO1FdEThnU&list=PLmRTcTRr9f_NHg1xigLp2mb2uSCLL407c&index=20&t=9s&ab_channel=CodeMonkey

https://www.youtube.com/watch?v=1bO1FdEThnU&list=PLmRTcTRr9f_NHg1xigLp2mb2uSCLL407c&index=20&t=9s&ab_channel=CodeMonkey https://www.youtube.com/watch?v=ubUPVu_DeVk&list=PLmRTcTRr9f_NHg1xigLp2mb2uSCLL40 https://www.youtube.com/watch?v=ubUPVu_DeVk&list=PLmRTcTRr9f_NHg1xigLp2mb2uSCLL407c&index=19&t=1629s&ab_channel=CodeMonkey 7c&index=19&t=1629s&ab_channel=CodeMonkey вт, 2023 年 16 月 4 日。17:42,yura88 Yura88 @.

>: …… <#m-768254453492461867> Try uncommenting "//mass.InverseInertia[1]" in FreezeverticalRotationSystem (freeze position) In prefab change physics shape to BOX P.S. But the best solution would be to implement a system that focuses on the speed of the character. If the character is standing still, then do not apply the movement force to him. вт, 16 мая 2023 г. в 16:22, oshellhahaha @.>: > [image: image] > https://user-images.githubusercontent.com/30201320/238656865-4022161e-e489-4dd5-9c65-9c3056e13d32.png

— > Reply to this email directly, view it on GitHub > <#1 https://github.com/yura8822/ECS_PathFinding/issues/1>, or unsubscribe > https://github.com/notifications/unsubscribe-auth/AKZ5MN7774EKZRINSP5EN2LXGN5SRANCNFSM6AAAAAAYDUZURA . > You are receiving this because you are subscribed to this thread.Message > ID: @.***> >

Thank you, I just started learning Unity ECS recently.

— Reply to this email directly, view it on GitHub https://github.com/yura8822/ECS_PathFinding/issues/1#issuecomment-1549838469, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZ5MN6ZYYJMTDJTLFZVN5DXGOIRTANCNFSM6AAAAAAYDUZURA . You are receiving this because you commented.Message ID: @.***>

oshellhahaha commented 1 year ago

Thank you very much, I know. However, a lot of learning materials are based on the old version of Unity ECS, so I am currently learning based on the old version.

yura8822 commented 1 year ago

You are right, in any case, the project should start with the latest version. In my project, it is no longer possible to raise the version to 1.0 (((

вт, 16 мая 2023 г. в 18:06, oshellhahaha @.***>:

Thank you very much, I know. However, a lot of learning materials are based on the old version of Unity ECS, so I am currently learning based on the old version.

— Reply to this email directly, view it on GitHub https://github.com/yura8822/ECS_PathFinding/issues/1#issuecomment-1549858360, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZ5MN4SR7BYJMYE2PBO7VTXGOJYNANCNFSM6AAAAAAYDUZURA . You are receiving this because you commented.Message ID: @.***>

oshellhahaha commented 1 year ago

Sure, I'd like to know if it's possible to stop pathfinding midway in this example.

yura8822 commented 1 year ago

If you are interested in the distance sufficient to move to the next point, then: PathFollowSystem -> if (math.distance(position.Value, target) < 3.5f); And if, upon the occurrence of some event, you need to stop the movement along the path: you need to clear DynamicBuffer pathPositionBuffer

вт, 16 мая 2023 г. в 20:28, oshellhahaha @.***>:

Sure, I'd like to know if it's possible to stop pathfinding midway in this example.

— Reply to this email directly, view it on GitHub https://github.com/yura8822/ECS_PathFinding/issues/1#issuecomment-1550082230, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZ5MN647O7CI4A7CASRKFDXGO2LPANCNFSM6AAAAAAYDUZURA . You are receiving this because you commented.Message ID: @.***>

yura8822 commented 1 year ago

If I understand you correctly

    Entities
    .WithName("PathFollowSystem")
    .ForEach((DynamicBuffer<PathPositionBuffer> pathPositionBuffer, ref

PhysicsVelocity physics, ref Rotation rotation, ref Translation position, ref PathFollowData pathFollowData, in CharacterData characterData) => { if (pathPositionBuffer.Length > 0 && pathPositionBuffer.Length / 2 > pathFollowData.pathIndex) <--------------------HERE { pathFollowData.pathIndex = -1; pathPositionBuffer.Clear(); } <--------------------HERE

        if (pathFollowData.pathIndex >= 0)
        {
            int2 pathIndex = pathPositionBuffer[pathFollowData

.pathIndex].position; float3 pathWorldPosition = getWorldPosition(pathIndex.x, pathIndex.y, cellSize, originPosition); float3 target = offsetPositionToCenter(pathWorldPosition, cellSize);

            float3 dir = target - position.Value;
            dir.y = 0; // блокируем ось y, для строго перпендикулярного

направления вектора

вт, 16 мая 2023 г. в 20:55, yura88 Yura88 @.***>:

If you are interested in the distance sufficient to move to the next point, then: PathFollowSystem -> if (math.distance(position.Value, target) < 3.5f); And if, upon the occurrence of some event, you need to stop the movement along the path: you need to clear DynamicBuffer pathPositionBuffer

вт, 16 мая 2023 г. в 20:28, oshellhahaha @.***>:

Sure, I'd like to know if it's possible to stop pathfinding midway in this example.

— Reply to this email directly, view it on GitHub https://github.com/yura8822/ECS_PathFinding/issues/1#issuecomment-1550082230, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZ5MN647O7CI4A7CASRKFDXGO2LPANCNFSM6AAAAAAYDUZURA . You are receiving this because you commented.Message ID: @.***>

oshellhahaha commented 1 year ago

Thank you very much, I just noticed this news now. I have an AI pathfinding plugin that uses the latest version of Unity.Transform, but I want to change it to version 1 of Unity.Transform. I don't know how to get started on this yet.

yura8822 commented 1 year ago

If the question is only in Transform, then here's what needs to be changed: https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/upgrade-guide.html

ср, 17 мая 2023 г. в 16:47, oshellhahaha @.***>:

Thank you very much, I just noticed this news now. I have an AI pathfinding plugin that uses the latest version of Unity.Transform, but I want to change it to version 1 of Unity.Transform. I don't know how to get started on this yet.

— Reply to this email directly, view it on GitHub https://github.com/yura8822/ECS_PathFinding/issues/1#issuecomment-1551431294, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZ5MN7BL62VFNNUVUGQF7TXGTJF5ANCNFSM6AAAAAAYDUZURA . You are receiving this because you commented.Message ID: @.***>