I am trying to implement a Turning radius into my game but Im not sure it can be done in blueprints, or without a plugin.
Turning radius for what?
For a playable Beast.
You could try a boot leg solution where anytime the player is turning you also move the player forwards (or backwards if that is allowed and player is trying to do so), and if the player cannot move forward/backwards then you stop turning.
i know this is a few months old but could you (or anyone really) explain or better show how one would inplement that? im pretty new to the engine and i have been on a serch for a tutorial or similar for a while but can only ever find the “rotate and move forward simotaniously” awnser and never how exactly one would do that ^^’
Implement what, exactly. There are no details here. Open a new thread and detail what is needed.
- the movement component has turn rate, you can use that
- you can simply slowly rotate the character instead
- you can create a dummy vector for the character to interpolate their rotation to
How to approach it will depend on how you want the turning to work.
I am currently doing turning for my bot.
This is how so far:
- get movement direction from character movement
- get mesh or capsule direction from pawn
- get location points from: “Find PAth to Location Synchronously” drag return pin and get “path points”
- then draw line trace from point to next point, you will see paths of each robot
Now you have all data so:
- get DOT product between movement direction and mesh orientation
- get DOT product between mesh forward and vector made from (path point[0] and path point[1])
If DOT product is below 0.95 )dot product is cosine, so that would be like 15 degrees from forward path), switch from walking to turning.
Then there is matter what to use: character movement vector or results from path points.
This is why you should draw line trace trough all points to see predicted path, and decide when use one or another.
It’s going to turn out OP wants to use WASD for movement / rotation and you can throw it all out of the window…
Probably, usual fate of most post here.
But i did that turning vs moving code just yesterday so i can share what i found.
Example of:
The above is merely the CMC’s interpolation via the Rotation Rate.
if you keep feeding the character a location to move to, they will use this value. Technically speaking, no actual turning script is needed here. But we, obviously, have very little control over any nuances. You can turn those nav mesh points into a spline, and sample direction as you slide a dummy along it. Makes it pretty smooth.
The feel the real questions here is:
How playable is it? How manual is turning suppose to be?
oh i was very directly reffering to the the turn radius for playable beast problem the op had with the awnser of moving the player forwards when trying to turn, but youre right i will make a new thread later with more specific stuff to what i want, to not get off topic
edit: i found a solution by accident!(or more accurately found the mistake i made in my blueprint) and will not be making a new thread for now, still thank you to everyone in here