Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get nearest point problem
#1
Hi, this might be a very minor thing or I'm dumb or something. The problem is I can't get get nearest point to work. No matter what I do I can't get it to return values, well, sort of. I have more actions later in the FSM that sort of get some values but with weird offset and since I can't get the first one to work I can't confirm if it's me or the action that is wrong.

   
If you look you'll see I try to get a point at z -50, that should give TF around 500 and also a position with z at -50. But no matter what I do I get this and I don't know what to do.
Reply
#2
Hi
It seems the source point is ignored when it is not set to a variable.
To fix that, go to CurvyGetNearestPoint.DoFindPoint, and replace the first two lines with the following:
Code:
if (!mSpline.IsInitialized || SourcePoint.IsNone) return;
if (StoreTF.IsNone && StorePosition.IsNone && StoreUpVector.IsNone && StoreRotation.IsNone && StoreRotation.IsNone) return;
I will send the edits to the PlayMaker's team to release the fix
PS: Tf is always between 0 and 1
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Thank you, that fixed it. I actually tested with a variable but it didn't work either.

So to actually get the absolute position I have to multiply TF with length, or is there a more lazy way? :p

Also, how heavy is get nearest point? How many per frame can you use without running into trouble?
Reply
#4
(03-01-2021, 02:43 PM)Lupp_ Wrote: Thank you, that fixed it. I actually tested with a variable but it didn't work either.
You are welcome. From the bug reports about Curvy's addon, I think you are the only customer using them Big Grin

(03-01-2021, 02:43 PM)Lupp_ Wrote: So to actually get the absolute position I have to multiply TF with length, or is there a more lazy way? :p


That's not how you convert a TF to a distance. Use Curvy Get Value, input the tf, and output the distance
To understand the difference between TF and distance, and why multiplying a tf with length is wrong: https://curvyeditor.com/documentation/splines/start#units

(03-01-2021, 02:43 PM)Lupp_ Wrote: Also, how heavy is get nearest point? How many per frame can you use without running into trouble?
Depends on a lot of factors, can't give you a general answer. Best way to know is to try and profile.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
Yea, I thought about that too. But I do that a lot for other assets too, thinking I can't be the only one who's encountered this, even for non Playmaker stuff. According to the ratings Playmaker is far the the most popular asset, but yours seems to be over the average too, so there's no way. Maybe most customers are teams that fixes stuff themselves? I don't know.

That was mostly a joke question. But it was lucky I asked, I had no idea that's how position worked. Thanks.
Reply
#6
Um hi, I got a new problem. When I use distance in the get value action I get a correct values. However, any subsequent actions in the same state returns a completely wrong result. If you compare the 2 images you see the first is correct but the in the second(and following ones) it returns a position that does not exist. I can't figure out what's wrong.
       
These 2 images are from the same cycle, the first is the center point, the second is the front pos on a completely straight part. I think this only happens if I check world units. Those actions there I don't check it seems fine.
Reply
#7
Hi
I can't say anything above the above result. Since the inputs are differents, it's normal that the outputs are. I don't know much about the scene, so I can't say anything about what value is right or wrong. What you can do is to use the same input in both cases. If in that case the outputs are different, then yes I can see a clear a problem.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#8
I just tested and it does indeed create a wrong position with the same input as the first one. Is there anything else I should test that helps?
Reply
#9
In that case, please send me a reproduction case so I can debug. Will keep you updated
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#10
Ok, I looked into your project. To summarize, you are expecting that variables spawn_pos and 2 to have similar values, since their inputs are similar, but these screenshots show very different values. The reason is not due to some bug of Curvy Splines or its Playmaker addon, but due to the fact that spawn_pos's value is modified somewhere in your graph after it has been assigned a correct value by the action in you screenshot. What you see in your screenshot is its value after modification. Here is its value at assignment, as seen in my debugger:
(0, 0, -38.6)
   
You can see that value, without debbuger, by assigning the output of the action to some new variable that is used nowhere else.
In general, try always to assign values to different variables, it avoids confusion. For example you have a store_pos variable that depending on the moment in the execution of the graph stores either a tf or a distance. It is always better to have a variable storing the tf, and another storing the distance. I know that handling numerous variables in visual programming can take more effort than in written code, so I understand why you would like to reuse variable to store different things in it. It's up to you to weight the pros and cons of reusing variables.
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Connections Problem Juton 3 14 03-06-2024, 10:41 AM
Last Post: _Aka_
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
  Connection "next' control point jh092 3 15 11-22-2023, 11:47 AM
Last Post: _Aka_
  Spline.Length not updated unless I add a point to spline (or modify it) first. _RicO 3 6 08-26-2023, 08:41 AM
Last Post: _Aka_

Forum Jump: