#2
7th Jun 2021 at 4:27 PM
Last edited by gamefreak130 : 7th Jun 2021 at
6:04 PM.
Posts: 437
Thanks: 5330 in 22 Posts
20 Achievements
You could try World.GetNearestSwimmingPoint(). It takes a Vector3 position and returns a boolean representing whether the search succeeded, plus two "ref" variables: a Vector3 representing a point on the shoreline, and another Vector3 representing...some other point in the water, I'm not entirely sure. I don't think it would work for pools, but it should work for ponds and oceans both on and off lots.
Take a look at the Run method of FishHere for an example.
Code:
Vector3 shorePos = Vector3.Invalid;
Vector3 oceanPos = Vector3.Invalid;
if (!World.GetNearestSwimmingPoint(sim.Position, ref shorePos, ref oceanPos))
{
return false;
}
"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt
If you enjoy the mods I put out, consider supporting me on patreon:
www.patreon.com/Gamefreak130