Help Obi rope cutting not accurate
|
30-11-2021, 12:14 PM
(30-11-2021, 12:07 PM)debruw Wrote: Hello i am using default rope cutting script. But my rope is not cutting where it appear on the screen. Hi, What do you mean the "default rope cutting script"? There's no such thing, closest I can think of is the script that comes with one of the sample scenes...
30-11-2021, 12:40 PM
30-11-2021, 12:47 PM
(This post was last modified: 30-11-2021, 12:48 PM by josemendez.)
(30-11-2021, 12:40 PM)debruw Wrote: Yes, i am using the script from sample scene. So we're talking about the RopeSweepCut script, right? This should work fine, all it does is take Input.mousePosition, unproject it to world space and calculate a line-line intersection. Just make sure the camera object you've dragged into the script's "cam" property is the one you're actually looking trough. Otherwise it won't work.
30-11-2021, 01:28 PM
(30-11-2021, 12:47 PM)josemendez Wrote: So we're talking about the RopeSweepCut script, right? This should work fine, all it does is take Input.mousePosition, unproject it to world space and calculate a line-line intersection. Okay thanks!
30-05-2022, 11:56 AM
(30-11-2021, 12:47 PM)josemendez Wrote: So we're talking about the RopeSweepCut script, right? This should work fine, all it does is take Input.mousePosition, unproject it to world space and calculate a line-line intersection. Hi Jose, I have a problem with mobile builds, swipe and cut mechanic is not working on touch screens. Do you have any example for touch screens? Thanks!
30-05-2022, 12:11 PM
(30-05-2022, 11:56 AM)martymayfly Wrote: Hi Jose, I have a problem with mobile builds, swipe and cut mechanic is not working on touch screens. Do you have any example for touch screens? Thanks! Hi! The swipe script included with Obi is just an example, you're supposed to write your own. Take a look at Unity's API for touch screen input, shouldn't be too hard to convert the sample script so that it uses touches instead: https://docs.unity3d.com/ScriptReference/Input.html https://docs.unity3d.com/ScriptReference...Touch.html
31-05-2022, 11:03 AM
(30-05-2022, 12:11 PM)josemendez Wrote: Hi! Hi, First of all, your script is working in Unity but it is not working when i build on a real device (Samsung S7, iPhone 7..). By the way, Input.GetMouseButtonDown(0) can also be used for touch screens. But I have also tried Input.GetTouch in the code and build on a real device and nothing changed. Have you tested before Obi Rope swipe cut on mobile real devices? I'm working on mobile gaming and chose the Obi Rope to use on mobile. So, I will appreciate if you try on real devices and help me. Thanks.
31-05-2022, 11:12 AM
(This post was last modified: 31-05-2022, 11:17 AM by josemendez.)
(31-05-2022, 11:03 AM)martymayfly Wrote: Have you tested before Obi Rope swipe cut on mobile real devices? I'm working on mobile gaming and chose the Obi Rope to use on mobile. So, I will appreciate if you try on real devices and help me. Hi, Just tested the script on iOS (iPhone 7) and it works just fine. Have you checked the console in XCode for null ref errors or other issues that would be preventing the script from running at all? (31-05-2022, 11:03 AM)martymayfly Wrote: By the way, Input.GetMouseButtonDown(0) can also be used for touch screens. Only if Input.simulateMouseWithTouches is enabled, and even then it only works for 1 touch (the first one). This is mentioned in the script's comments: Code: /**
31-05-2022, 12:38 PM
(31-05-2022, 11:12 AM)josemendez Wrote: Hi, Hi Jose, The problem is about the shader code in AddMouseLine() method. Code: lineRenderer.sharedMaterial = new Material(Shader.Find("Unlit/Color")); I don't know why but shader is null after that code. I created and assigned a material and it is working now. Last question; which solver backend do you recommend for mobile games, Oni or Burst? Thanks for your support. |
« Next Oldest | Next Newest »
|