Align to Ground not strong enough!

Vlaxep

Active member
I'm trying to use 'AlignToGround' for the following scenario, but it's not working 'strongly' or 'sticky' enough to keep my character aligned:

- I have a Spaceship with a rigidbody which can fly around
- I'm testing the 'floor' of the ship as a 'MovingPlatform' as well as standard box collider element
- Have bumped up the SticktoGround > Stickiness to 200
- Min Horizontal Moving Platform Stick speed > to 1000
- AlignToGround ability always on, as I'm already in position inside the ship

If I'm gentle flying the ship around it's 'okay' but with a bit of movement the character starts getting thrown about and can't align to ground fast enough or strong enough.

I need to have the character stick 'absolutely', not worried about being able to jump or anything except ragdoll for death, though would still entail sticking to ground if possible.

The main thing is just being able to get the player to stay normal to the ground inside the ship despite the ship flying around in all rotations/directions.

I'm wondering how can I get the strongest result here and what is the best environment ie 'MovingPlatforms' or 'Normal' Colliders and should they be convex or concave?

Cheers
 
In this case, I would say you should just have your character object get set as a child of the spaceship object, so that its position and rotation get matched to the spaceship at all times. You'd still want to keep the StickToGround stuff intact so that the character can maintain a local upwards direction whilst the spaceship rotates, but hopefully setting your character to be a child of the spaceship object will help with fast movements.

If your spaceship object is moving in a predictable pattern, i.e. from A to B, then moving platforms might be useful, otherwise I don't see any use for them in this particular case.
 
Ok thanks @Andrew,

I think I tried that a while ago and it didn't help. Will try again now I have lots of other things in place.

The ship undergoes some hefty forces I think so it just pinballs the player around.

I just came across 'Move With Object' ability, was going to see if that was similar...
 
Ok so @Andrew parenting the Player to the Ship made a huge difference combined with ALIGNTOGROUND

My problem now is I can test the ability by 'enabling' in the inspector, but I need to make the AlignToGround ability active when the player enters a trigger collider on the spaceship.

I'm not a coder - I use 'Bolt' visual scripting. I cannot for the life of me make the 'UltimateCharacterLocomotion.TryStartAbility' work, there's probably a way to call it it's just insanely complicated I've tried it so many different ways...

Is there a way to add a component to the floor or some other way to just tel the Character when it's in the trigger or something else to trigger the ability?

I'm also checking out the demo scene and I have no clue as to how the ability get's activated when entering the 'gravity room'????
 
So I'm trying to at least use the DetectObjectAbilityBase based on the video:


I've tried adding it to the AlignToGround or AlignToGravity scripts but it just causes compiler errors. I don't get how to do this on an existing ability compared with a new one as in the video.

So I can't get the 'ObjectDetection' parameter to set a trigger in the inspector when going back to the Abilities....

Also I'm wondering since I've got a 'SimpleGravityZone' (from this thread https://www.opsive.com/forum/index.php?threads/cube-shaped-gravity-zones.3118/)

— which seems to work and continue to 'Update' it's gravity direction , it seems to me that 'AlignToGravityZone' ability does not continue to update once set? Is that correct?

Bascially I'm just leaving 'AlignToGravityZone' on always, and also beginning runtime with Character inside a Gravity zone.

I can see it appears the values of the 'SimpleGravityZone' update correctly, but the Character does not Update it's alignment to the changing position and direction of the Gravity zone as my spaceship moves and rotates, despite the player being parented to the ship and 'moving along' inside of it fine. So the result is the Character just remains with it's 'GravityDirection' set to the where it first initialised it's detection of the Gravity zone. That's what I'm thinking is happening at least!

Realistically if I can get the Character to align to the 'Floor' of the ship with AlignToGravityZone just like in the Demo scene, but on a 'moving' floor, the solution will be perfect.

That way I can leave AligntoGravityZone on always and then it only works when actually in a Gravity Zone!

Alternative is AlignToGround, which I really don't like the result of, but even still I'm just completely unable to begin this ability on the player entering the trigger, same reason as above, I can't add that DetectObjectAbilityBase class without causing compiler errors.

AlignToGround would be a rough solution for now, but if there's a way to get the Character to constantly align to the changing AlignToGravityZone would be perfect. @Justin any insight?
 
PS Also AlignToGround is not ideal also as jumping causes the Character to get stuck midair with his knees up lol
 
Ok so I think I managed to finally solve this! OMFG this has been absolutely killing me, and now it seems so easy lol.

Made a video of the Integration of Ultimate Character Controller and SpaceCombatKit — this has been real tough integrating the two!
But really worth the effort, I'm really happy with how it is turning out now!

DEMO VIDEO HERE — about half way through I demonstrate the Character staying 'aligned to ground/gravity zone' while the ship is spinning on it's Z axis reasonably fast. A bit of Camera shaking depending on Cmaer view position but can iron this out later!

So I think all the elements combined to make this work are:

- AlignToGravityZone enabled (Active on Enter Gravity Zone)
- Box collider Gravity Zone with script from the thread here
- I use 'Bolt' visual scripting so I have a flow machine 'parenting' the Character to the Gravity Zone object itself, which itself is a child of the ShipVehicle
(See flow machine here)
1607179765295.png


I put all this here in hope it may help someone else someday, and save them dozens of hours that I've spent!

Cheers for the help along the way @Andrew !
 
Top