Would you by any chance have a snippet of how this could be done i totally have no clue. i would greatly appreciate it & thank you so much for replying & your time.
Sure search for
GetWorld()->LineTraceSingleByObjectType(Hit, TraceStart, TraceEnd, ObjectParams, TraceParams);
in the project and replace it with the code in there
Thanks outtaspace
Hey i tried your fixes but 1. car sometimes bounces into air doing back flips
2. Grip friction seems non existent slips all over the place almost impossible to drive
3. as for the car un spawning do to “Warning: TegCar_3 is outside the world bounds” still happens even after the fixes posted by Outtaspace. After disabling “Enable world bounds” in world settings which is on by default and restarting i didnt get the un spawning. But again not sure if it should be considered a fix as disabling that feature from the project may have other side effects.
4. And no matter what the car takes a long time to brake. maybe a handbrake feature would be nice.
so does anyone have any luck or thoughts with this?
Did you forget to recompile possibly?
The fixes were flawless for me and I only ran the default setup
- is due to float GripMultiplier = FMath::Max(TraceLength/SpringLengthArray[Index], MaxGrip);
SpringLength array goes from Tracelength to 0 and therefore can run into really large numbers in certain situations - Grip will be lower but it should be far nicer to drive as the slip ratio vs slip angle is clamped in a circular radius instead of a square radius
- This is due to the FVector() being uninitialised if the FVector gets initialized on an already full space in ram it essentially adds a random velocity (usually just sets the velocity to INF)
- You can increase the brake strength it’s a variable
Also try setting the grip mult to 1 instead of 1.05
If you’re 100% sure you’ve done all the fixes and recompiled I’ll re-download the project and redo all the fixes on my end then upload.
i am 100% sure also im using my own model which was stated that the model used was broken or something. Oh and of course i recompiled, actually to me recompiling has become a habit for me
note: im using VS2017 in UE4.22.2 not 4.22.3 i dont see any interesting fixes in that version
So just making 100% sure. Cause when you recompile plugins you have to delete the binaries and intermediate folder.
https://answers.unrealengine.com/que…d-plugins.html
I redid the steps against the original file and everything was fixed.
I will also agree that the car is a lot more undrivable. However once you tweak the params it should be fine. The change I made were:
-
Using the Trophy truck model instead of the impala. The trophy truck is lighter weight and the smaller wheelbase helps too
make sure you move the arrows if you do this -
I used the elliptical grip model I proposed. If you don’t like the results of this feel free to not use it
-
I made sure to do the FVector() to FVector(0) changes and the FMath::Max(TraceLength/SpringLengthArray[Index], MaxGrip) to FMath::Min(TraceLength/SpringLengthArray[Index], MaxGrip) change.
As it changes from Max to Min the grip is reduced however it makes the simulation a lot more stable as it can never reach the /0 condition. The way the variables are also worded it seems like using Max was a mistake and Min was supposed to be used.
It’s still not perfect but it’s improved and it won’t run into any weird crashes.
can you please send me your project file? Oh and by the great find. What i noticed is when i raise grip to even a crazy number like 999999999 it slips all over the place so if you can can you please upload your project file or just the modded plugin to test it out on my side? Thanks again mate.
If you want to modify grip have a look at the slip forces instead of using grip.
Did you end up fixing the disappearing and random spinning out issues?
There are two FVector() parts that need changing make sure you don’t miss one
Hi Outtaspace, as for the disappearing i turned off enable world bounds in the world settings but isee that as a work around at the momment i dont know if ill need to turn that back on again on the remainder of my project. but with it enabled it disappears. As for random flipping that is still present. And Yes the FVector() i changed to FVector(0) so that it wouldnt have a non- initialized value. Now you mention slip forces where can i adjust that? is it in a value?
Oh and The Car doesnt want to Brake like it takes a while no matter what value i put in.And what does the skid sound do, because its not doing anything
good to see people are getting some use out of this still.
@outtaspace feel free to upload your own version of this with any fixes or improvements, same goes for anyone else. it was always intended as a base for anyone to develop and use as they see fit with the hope they would share the knowledge with the unreal community.
Hi tegleg how have you been doing. Cheers. Have you done anything new to your car project? i would really love to use it in my project but i cant seem to get a few things working. I would love to hear from you. Take care mate.
hi porkchop im good thanks hope you are ok.
i have long since abandoned UE4 and rarely check the forums so no i havnt done anything with this project.
something that springs to mind with outtaspace’s fix is that i never implemented ‘wheelspin’ properly so this could be why you are experiencing some of the problems with grip.
boredengineer posted how to do it somewhere in this thread if anyone wants to try. there is a feedback loop between engine revs and wheel revs that is not present in this project. the visual wheels rotate depending only on the ground speed.
the smoke and sound are lifted from the unreal wheeled vehicle example and come into play when there is an excess of power, but its very crudely done. my main focus was the suspension as i wanted a car that didnt ping into outerspace by going over a curb like the epic example.
i do not plan to develop this any further myself but will try to keep on top of engine updates that break it.
Ok Thank you for the response & glad everything is ok.
Hey guys,
I’m at the point now where you started. I’m working on my game since half a year and did my vehicle movement (tanks and nwheeled armored cars) veeeery basic. Like as basic as it gets, I’m just moving the meshes with addLocalOffset and addLocalRotation. Having my formulas behind it looks nice and works flawlessly. One might laugh at the approach but it really just serves the purpose I needed and it looks good. However as soon as physics come into play its not very realistic. You can fly around and move up 90° slopes because its not force based, also my meshes don’t have a velocity since I’m just pushing them around with offsets and if you crash 2 of them into each other they fly around. Plus I don’t have a suspension yet which worked for tanks but the wheeled vehicles look horrible without it.
So I’m a little uncertain on how to proceed. I want to do it all on blueprint, mainly due to issues with porting to other engine version and I have all my other logic in there as well. There are many people that tackled the rework of a wheeled vehicle component but I could not find one that worked for me. I’m at UE V4.23.1 atm and couldn’t get a single one to work (compilation errors and missing plugins).
@tegleg I’m currently downloading the 4.22 version of the engine and hope it will run there, could not get it working on 4.23.
@BoredEngineer I also tried the MMT-project but with the same issue, can’t get it to work on 4.23 and from the look of the demo project it looks too complicated for me (I’m not heading for physical simulation perfection, rather a well adjustable simplistic system that makes it look as real as possible).
At this point I’m thinking about making a simple wheel component just as you guys started. Meaning a BP-class that you can add to your actor (as many as you want) which includes all the logic (suspension, friction, thrust/engine) with parameters to tweak how it reacts. If you were to restart at such point, what tips would you give? Or is there something like this out there that you know of that works with newer versions? (Theres 4.25 out now and they wont stop making new ones).
I also tried out the built-in systems with vehicle component (which doesnt work for tracked vehicles) and an approach using constraints and sphere collision but I cannot control those as much as I need (e.g. something trivial as getting the response if the wheels are in contact with the ground made me go crazy). With a setup as linetrace its very easy to do it. Also I could not get the spheres to rotate without using an angular motor so that approach pretty much died for me. But the basic suspension was working, just not the moving part.
Sorry if I got something wrong or there is an obvious solution but I’m just stuck there atm and not sure on how to proceed without the problems mentioned.
Thanks and have a nice day,
Lai
Never mind, got it figured out mostly and works as I wanted for any type of wheeled vehicle so far. Will adapt it to also support tracked vehicles now. How a template like this is not included in the engine blows my mind. If someone is interested in it let me know (Wheel in BP only, can drag it onto your pawn and set up the suspension, steering and stuff as you like).
Cheers
I know this old but just started working on a custom vehicle blueprint with little success. Could you share a link to a sample project?