GearedGeek
Active member
Are you guys using the GitHub version or the store version? https://github.com/wave-harmonic/crest
a video actually shows how to do it, and we could learn from it. Just telling us you can do it doesn't really help.Was able to set this up pretty easily, thanks again @ChristianWiele
@VintageRoots What have you tried, between the Swim set up instructions and Christian's instructions everything worked pretty smoothly for me.
could you please make a video about it? it's been around 1 year and no one bothered to make oneI created a empty game objects and placed all my ocean components in the inspector, and made its layer water , added the box collider and did as stated above
namespace Ai.Atnc.Abilities
{
using Opsive.UltimateCharacterController.AddOns.Swimming;
using Opsive.UltimateCharacterController.Character;
using UnityEngine;
using Crest;
public class SetWaterHeight : MonoBehaviour
{
private UltimateCharacterLocomotion characterLocomotion;
private Swim swimAbility;
private SampleHeightHelper sampleHeightHelper = new SampleHeightHelper();
private void Start()
{
characterLocomotion = GetComponent<UltimateCharacterLocomotion>();
swimAbility = characterLocomotion.GetAbility<Swim>();
}
void Update()
{
var sampledHeight = SampleWaterHeight();
swimAbility.SetWaterSurfacePosition(sampledHeight);
}
private float SampleWaterHeight()
{
var position = characterLocomotion.transform.position;
sampleHeightHelper.Init(position, 0f, false);
sampleHeightHelper.Sample(out float height);
return height;
}
}
}
Could you please help me understand your implementation?"Then I had to adjust the trigger height of the ocean to be on the level of the highest waves"
that is exactly what i was asking, using a collider is not realistic when you have a whirlpool of water or whenever there is a storm... it looks just offAlso, if anyone has figured out how to bypass the need for the collider please let me know.
Thank you so much for the asset! i bought it yesterday and you just replied! <3 ill make a video showing how i try to implement it so we can finally show exactly how to set this up. i bought USC to drive around water with the water asset made by NWHwater height detection should be Custom, and you should have the component attached to feed in the values. The collider becomes irrelevant after entering and triggering the ability, just make sure its higher then your waves, and deeper than you wish to swim underwater. From there play with the buoyancy value. I actually made a test with my Ultimate Seating Controller Asset and had Nolan driving underwater with the submarine even, and it was very very easy. There's instructions in the USC Documentation on how to achieve this.
Please help, what am i doing wrong? what do i need to add?I am using the Crest system with the standard swim ability. I set the "Water height detection method" to custom, and created a script that updates the water height every frame (through the SetWaterSurfacePosition() method of the swim ability).
Then I had to adjust the trigger height of the ocean to be on the level of the highest waves. I also had to set the "Surface buoyancy amount" of the swim ability to 0.5. With this if works just fine. Here's my minimal script.
Code:namespace Ai.Atnc.Abilities { using Opsive.UltimateCharacterController.AddOns.Swimming; using Opsive.UltimateCharacterController.Character; using UnityEngine; using Crest; public class SetWaterHeight : MonoBehaviour { private UltimateCharacterLocomotion characterLocomotion; private Swim swimAbility; private SampleHeightHelper sampleHeightHelper = new SampleHeightHelper(); private void Start() { characterLocomotion = GetComponent<UltimateCharacterLocomotion>(); swimAbility = characterLocomotion.GetAbility<Swim>(); } void Update() { var sampledHeight = SampleWaterHeight(); swimAbility.SetWaterSurfacePosition(sampledHeight); } private float SampleWaterHeight() { var position = characterLocomotion.transform.position; sampleHeightHelper.Init(position, 0f, false); sampleHeightHelper.Sample(out float height); return height; } } }
You have done everything correctly apart from adding the collider for the water, the ability uses the collider to activate. The collider should be as big as your swim areaThis video shows how im trying to follow this guide but failing:
Please help, what am i doing wrong? what do i need to add?