Edy's Vehicle Physics

RedHawk

Member
Version 1 of my Integration with Edy's Vehicle Physics is done. It's not exactly where I want it to be and it has limitations. For example, if you want to be a passenger and fire a weapon, then there will be issues that I don't know how to get around (Yet). Also, I have not tested if the Player can be killed while driving the vehicle.

If you don't know what Edy's Vehicle Physics is, check out this link https://assetstore.unity.com/packages/tools/physics/edy-s-vehicle-physics-403.

I will post the scripts and video of how to use it soon with a Link below once it's done.
https://redhwk.wordpress.com/opsive-and-edys/


DOES NOT WORK WITH UCC Version 2.1.3 and NEWER due to changes Opsive made by adding "Move with Object"

Version 2 located here:
https://redhwk.wordpress.com/opsive-and-edys/opsive-and-edys-vehicle-physics-evp-version-2/
 
Last edited:
Within your ability I would modify the MoveDirection to match that of the vehicle. This is starting to open a bit of a Pandora's Box though because the character controller is updated within FixedUpdate and then smoothed within Update, but if you just have a vehicle updating within Update then you'll likely receive a slight stuttering. The proper fix for this is to have the vehicle updated within FixedUpdate and then smooth the results.
 
Within your ability I would modify the MoveDirection to match that of the vehicle. This is starting to open a bit of a Pandora's Box though because the character controller is updated within FixedUpdate and then smoothed within Update, but if you just have a vehicle updating within Update then you'll likely receive a slight stuttering. The proper fix for this is to have the vehicle updated within FixedUpdate and then smooth the results.
I wish you wouldn't have deleted my other thread. I posted the solve to the Move piece already by using UpdatePosition and UpdateRotation within the Ability.

Now this leaves my other question which was deleted. Could you please either un-delete the other questions which was very specific, or answer it here.
 
Last edited:
The camera no longer moves/pans/rotates (whatever you want to call it) when I move the mouse.

What am I missing? I can't figure it out.
 
Last edited:
I didn't realize that you had edited your original post in this thread. Unfortunately I'm not able to revert the other threads so if you can just keep adding to this thread to keep things organized that would be great.

The camera no longer moves/pans/rotates (whatever you want to call it) when I move the mouse.
Unless you changed view types abilities aren't able to change camera behavior. Did you set the gameplay input to false?

https://opsive.com/support/documentation/ultimate-character-controller/input/
 
I didn't realize that you had edited your original post in this thread. Unfortunately I'm not able to revert the other threads so if you can just keep adding to this thread to keep things organized that would be great.


Unless you changed view types abilities aren't able to change camera behavior. Did you set the gameplay input to false?

https://opsive.com/support/documentation/ultimate-character-controller/input/


I just added the following to AbilityStarted() and the same statement but true in AbilityStopped(), but there was no change:
EventHandler.ExecuteEvent(m_CharacterLocomotion, "OnEnableGameplayInput", false);

Initially, I was trying the following in AbilityStarted() and false statement in AbilityStopped(), but it didn't work either:
for (int i = 0; i < m_CharacterLocomotion.MovementTypes.Length; ++i)
{
m_CharacterLocomotion.MovementTypes.ForceIndependentLook = true;
}


I don't want to use the VehicleCameraController that comes with Edy's. I'm trying to use only UCC except for the actual Vehicle pieces.
 
Last edited:
Executing OnEnableGameplayInput is the reason the camera stops moving - this will disable the input on both the camera and the controller. Instead under the General options of your ability you can disable Positional/Rotational input and that'll prevent the character from responding to input while the ability is active. With this setup the camera will still work as well.
 
Executing OnEnableGameplayInput is the reason the camera stops moving - this will disable the input on both the camera and the controller. Instead under the General options of your ability you can disable Positional/Rotational input and that'll prevent the character from responding to input while the ability is active. With this setup the camera will still work as well.
Well, I've had those things disabled all along. I only added/tried that OnEnableGameplayInput when you mentioned it. I even removed that for loop I had in there, because that was also a test (which didn't work).

Removed Image - will have an updated one soon
 
Last edited:
This is what I have so far: https://redhwk.wordpress.com/opsive-and-edys/

Issues:

  1. Character is very jittery. I'm using UpdatePosition and UpdateRotation, but it does not work that great.
  2. I have to use the VehicleCameraController from Edy's. You can see that works fine, but when I change views the jittery character messes the view up. Therefore I need to figure out how to fix item 1. Notice the in the car view with the strange bouncing up and down rapidly, that's not me with my mouse it's the item 1.
  3. The UI didn't set up properly. I have this new scene, I used the UCC manager, set up camera, setup scene, set up ui, and setup virtual controls. Notice how I don't get the vehicle message when I walk up (even though you can see it's set up in the above post).
So, while this all technically "works" and I can always just make the UCC character disapear, I really want it working super fluid before I share. Any help???
 
Last edited:
Number 1 relates to this post. EVP is updating at a different rate than UCC so it is going to cause stutter. The fix will likely involve a deeper integration than just the ability system.

Related to number 3, do you have a MessageMonitor? It doesn't look like any UI is showing up - can you try a fresh scene with just a character and the UI to get that working?
 
Yeah, this one is going to take me a while. It's crazy cause if I manually turn off the Character locomotion, it looks just fine (minus the IK). Also, everything on EVP is using FixedUpdate already (except the Camera, but changing it from LateUpdate to FixedUpdate had no affect).
 
Last edited:
I feel your pain, I had the same problem UCC character riding on a non-UCC object.
I hacked up by just disabling UCC character's movement (animation, input are enabled) and making the vehicle the simple parent to the character.

However, this method will fail if you need to move around on the non-UCC moving object (like a train with its own physics system). I'm having quite a bit of problem trying to figure out a way but all failed.
 
I feel your pain, I had the same problem UCC character riding on a non-UCC object.
I hacked up by just disabling UCC character's movement (animation, input are enabled) and making the vehicle the simple parent to the character.

However, this method will fail if you need to move around on the non-UCC moving object (like a train with its own physics system). I'm having quite a bit of problem trying to figure out a way but all failed.
Next thing I'm going to try is to see if I can figure a way to make my vehicle a moving platform.
 
Last edited:
Progress - I got the jittery stuff to go away except at really high speeds.

So far, I'm using the Ability functions of ApplyRotation, UpdateRotation, ApplyPosition, and UpdatePosition. Within these, I've basically copied the MovingPlatform pieces, and tweaked them to only use one line each with no additional options which seem to work.

Next I need to fix my IK stuff for the UpperBody cause he leans forward too much (like riding a Sport Bike - motorcycle). Could be that I need to change my Animator Layer (Full Body Layer right now) to the Base Layer.
 
Last edited:
Awesome to hear that you're making progress :) It has been awhile since I looked at EVP but since it is in FixedUpdate that's a good start. Take a look at the scriptable execution order so EVP is updated before the Deterministic Object Manager.

Could be that I need to change my Animator Layer (Full Body Layer right now) to the Base Layer.
You'll likely only need to create a new state that lowers the Look At Body Weight.
 
I'm pausing on this for a little while. Here is what I currently have, but it is in no way where I want it to be. Maybe someone will see something that I'm missing and can help me. I followed the Animator steps, and only used one Animation which was the AimCrouchIdle (already included). I did create State Presets for the CameraController, CharacterIK and UltimateCharacterLocomotion. I also put the VehicleCameraController on the same camera the UCC uses (MainCamera).
 
Last edited:
The below is what I put on my main vehicle parent. Also note you have to create a Drive Position and the IKTargets.
REMOVED - Will repost on my website later
 
Last edited:
This is awesome! I did this for TPC V1 and Edy's, but I simply swapped out controllers and never got to the point of having the character in the vehicle or IK driving although I planned on it. Def using this and going to start working on Entry / Exit animations and logic. I'll share when I have something. Thank you so much RedHawk! You're the man!

And as always, thanks Justin!
 
Top