VintageRoots
Member
Has anyone used the swimming pack with Crest ocean system? I'm trying but i see crest has no colliders, its a shader. How would you implement swimming with crest ocean system?
I haven't used Crest before. Does it allow you to assign a layer to the shader?Has anyone used the swimming pack with Crest ocean system? I'm trying but i see crest has no colliders, its a shader. How would you implement swimming with crest ocean system?
Amazing! I'll gladly pay for your services to help me get the crest and opsive integration workingJustin said I could share a diff patch on the forum since I have so much code from the paid swim.cs in it. You and I would I need to run command line stuff to do that which I'd have to figure out. I think this is pretty error prone and I'd rather keep it simple for myself and directly support you via email / screenshare if you are serious.
If you or someone else wants to contact me about this ability, you can find my contact information here:
Far Beyond Code LLC
www.farbeyondcode.com
I'm a web developer just getting started with Unity.
You might want to wait until I get more things working and have smoother movement, though it will be random timing when I do this work. It could also be useful as is if you just need the basics in order to take it in another direction. It might be easier to do through email / screen share if you are super motivated to get this working. At the moment, it is kind of standalone but I'm starting to mix some features to reuse the crest data efficiently for other things. And you need to have a scene with UCC and crest already setup, which might require some extra steps.
Will try this and let you know how it goes ill record it if it worksI just spent all weekend learning how Crest works and how Ultimate Character Controller works. I just figured out how to get my UCC character to enter and exit Crest Water System and I'm sampling the water height and flow data from Crest to do this, so I will be able to apply pseudo-realistic movements and glide down the waves, etc. It was very hard and confusing since this was my first time making a custom ability for UCC, and I had numerous problems with both crest and UCC to work through. I am still not done. It's going to be awesome though. Even if you could do a collider on crest, that would probably hurt performance because the mesh would be too large. This method I used is the same code from their SimpleFloatingObject.cs script in the demo, but combined with a modified Swim.cs that doesn't require colliders to work because I removed its base class and rewrote some parts. I made this as a new ability called FloatOnCrest.cs in order to be able to keep swim with box colliders intact. It lets me go underwater and swim still as well. Very cool. I'm so excited about the quality of crest / enviro / gaia combined.
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 make a quick video showing this implementation? sounds amazing! it'd really help everyone in the community!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; } } }
I'll try it and report backcould you please make a quick video showing this implementation? sounds amazing! it'd really help everyone in the community!