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
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
|
« Next Oldest | Next Newest »
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Bug: Save Generator Outputs still saves outputs if object is disabled | curvymesher | 1 | 2 |
08-30-2024, 09:19 AM Last Post: _Aka_ |
|
Player move with object | mcarman | 4 | 8 |
07-29-2024, 06:49 PM Last Post: mcarman |
|
Nested Spline Volume Spot Instantiation | merobbins5 | 3 | 6 |
07-26-2024, 09:58 AM Last Post: _Aka_ |
|
Left-right movement, and spline follow | shihaya | 3 | 8 |
07-12-2024, 12:50 PM Last Post: _Aka_ |