Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Our response to Improbable’s blog post (and why you can keep working on your SpatialOS game). Read more here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Problem with system Physics.Raycast on android devices

Discussion in 'Physics' started by UDN_040a51f0-fa05-4717-8951-57dc1ee0debe, Jan 11, 2019 at 3:42 AM.

  1. UDN_040a51f0-fa05-4717-8951-57dc1ee0debe

    UDN_040a51f0-fa05-4717-8951-57dc1ee0debe

    Joined:
    Aug 4, 2016
    Posts:
    5
    Hey. I use the Physics.Raycast system to analyze the obstacles in the game, so that the character can perform various tricks depending on the obstacles and I am faced with the following problem:
    in unity, everything works well, and the obstacles are displayed correctly, when I collect everything on the ios platform, it's also good, but when I collect on the android platform, I see the following situation: from time to time Physics.raycast stops to collide with any objects that fall into its review ( only restarting the scene helps to solve). I tried to create a scene in which there was only one swivel beam per cube, and even on it on android devices, over time, raycast ceased to interfere with physics. If there were two such objects on the stage that did not depend on each other, the raycast was turned off on both. Has anyone encountered such a problem, if it came across, how did it solve it? I use unity 2018.2.20, switching to version 2018.3.0 did not solve the problem. I cannot return to Unity 2017, since the project immediately breaks all the prefabs
     
  2. SparrowsNest

    SparrowsNest

    Joined:
    Apr 6, 2017
    Posts:
    965
    Try to recreate the bug in a demo-project, if it works in 2017 and not in 2018 submit a bug report with the demo-project attached.

    sorry I can't provide more help, PC dev here.
     
  3. UDN_040a51f0-fa05-4717-8951-57dc1ee0debe

    UDN_040a51f0-fa05-4717-8951-57dc1ee0debe

    Joined:
    Aug 4, 2016
    Posts:
    5
    I was able to port the project to unity 2017. The problem with raycast is not gone. Could it be that due to the rays appearing inside the Collider, Raycast would shut down?
     
  4. SparrowsNest

    SparrowsNest

    Joined:
    Apr 6, 2017
    Posts:
    965
    I'm not sure I understand you right, but if a ray starts inside a collider I don't think it will detect said collider.
     
  5. UDN_040a51f0-fa05-4717-8951-57dc1ee0debe

    UDN_040a51f0-fa05-4717-8951-57dc1ee0debe

    Joined:
    Aug 4, 2016
    Posts:
    5
    If a Raycast is born once inside the collider, then the next time, if it is born outside of it, it ceases to collide with objects.
     
  6. UDN_040a51f0-fa05-4717-8951-57dc1ee0debe

    UDN_040a51f0-fa05-4717-8951-57dc1ee0debe

    Joined:
    Aug 4, 2016
    Posts:
    5
    I watched the console after the build on android devices, and it does not produce a single error (it just stops the raycast from colliding with objects)
     
  7. SparrowsNest

    SparrowsNest

    Joined:
    Apr 6, 2017
    Posts:
    965
    Submit a bug report.
     
  8. UDN_040a51f0-fa05-4717-8951-57dc1ee0debe

    UDN_040a51f0-fa05-4717-8951-57dc1ee0debe

    Joined:
    Aug 4, 2016
    Posts:
    5
    I found what the problem was. As it turned out the problem was not at all in the Raycast system. I used the Unity Cinemachine plugin and realized that CinemachineCollider breaks the Physics.Raycast system on android devices