11-29-2020, 07:01 PM
I was wondering if would be possible to have a ship hit a collider and then begin following a spline from it's current position. Is this something that would be possible with Curvy Splines?
Object enter spline from collider.
|
11-29-2020, 07:01 PM
I was wondering if would be possible to have a ship hit a collider and then begin following a spline from it's current position. Is this something that would be possible with Curvy Splines?
11-29-2020, 09:50 PM
Hi,
Yes, through the API. Add a Spline Controller to the ship, disable the controller, and when the collider is hit, in the hit callback (on collision or on trigger) move the ship to the nearest point of the spline (if needed) and then enable the controller. I hope this helped
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
11-30-2020, 02:15 AM
Okay cool, I will try that. How would I find the closest point to the ship in the spline? Would I have to shoot a raycast?
11-30-2020, 09:05 AM
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
11-30-2020, 06:32 PM
Worked like a charm thank you so much! I left a 5 star review for the app on Unity Asset store! Your the best!
11-30-2020, 06:33 PM
Oh, thank you
![]()
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
12-01-2020, 12:24 AM
So I was able to get this to work but I found a strange glitch. When I move the parent of the segments it causes the collision object to snap to the wrong part of the curve when it collides with it. If I move the individual curve spline segments it is fine though. Do you know what maybe causing that and if there is a good solution?
12-01-2020, 09:27 AM
Make sure you are using the right Space parameter in the methods you use. Maybe you are giving some method a position in the local space while it is expecting one in the global one.
If the issue is not related to this, you can send me a reproduction case? Keep in mind that this is a public forum, so do not share Curvy Splines on a post here. Share it via email or PM. Have a nice day
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
12-01-2020, 02:26 PM
Okay I just emailed you the scene package
12-01-2020, 04:39 PM
Hi
It ended up being an issue with using the wrong space in here spline.GetNearestPointTF(transform.position) You are using the override that takes a local position. Since you want to use a global position, you should replace this line with the following spline.GetNearestPointTF(transform.position, Space.World) Let me know if you encounter other problems. Have a nice day
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you. |
« Next Oldest | Next Newest »
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Curvy Line Renderer for UI Spline? | gekido | 7 | 1,258 |
07-13-2025, 07:11 PM Last Post: _Aka_ |
|
Is there a way to get the position of each ControlPoint in spline by API? | Chanon | 1 | 250 |
06-07-2025, 09:44 AM Last Post: _Aka_ |
|
Filling a closed spline dynamically | rickgplus | 1 | 458 |
04-16-2025, 08:56 AM Last Post: _Aka_ |
|
Morph game object along curve. | mikechr2000 | 5 | 1,023 |
02-04-2025, 09:30 PM Last Post: _Aka_ |