The red box is sliding on a slope, like in ski. I am trying to limit / clamp its rotation on the Z axis, so it cant turn after reaching 90 or -90 degrees. What I did with the following code was try and limit how much I can turn it based on my mouse input, and to some extent this works. However, this does not clamp the mesh from actually turning when influenced by any outside source (i.e hits an obstacle).
I am back with another issue, which has been bothering me all day. I tried fixing it alone trough various means, google didnt help, so I have to resort to asking you guys for help.
On the same project as above, I need to make a check if the (red) pawn is on the ground or not. The reason for this is that I want it to be able to break while going down the slope, but I dont want it to break mid-air.
Now, this works. For a while. When the pawn is falling from a ramp, or whatever, the AIR print string activates, and when it hits the ground (Landscape), it prints into GROUND. Also the breaking logic works flawless. But after a short while, especially after I just run out of placed ramps, and it just keeps going smoothly on a slope, it sets the AIR back. Sometimes it transitions back to ground, but I cant seem to replicate when exactly.
The collision box that does this check is just a cube placed beneath the pawn, I tried changing it in all shapes and sizes, to no avail.
Here is a picture of the slope, so you get a better picture:
None of these work properly for me. I must be doing something wrong.
Regarding “is Moving on ground”, I made this and bound it on event tick, it never toggles the “AIR” print string. It’s always on the ground.
Regarding the line trace, I made this, inserted it in the same place on tick and it only returns “AIR”, no matter how I tune the Get actor up vector.
And second: can you show us the blueprint logic of how you are lifting the character off the ground? Also a screenshot of the characters component heriarchy.
Hey,
He is not lifted, he is falling, so it’s just gravity. (btw, the “is falling” function doesnt seem to work either (instead of the "is moving on Ground).
The only thing with physics enables is the “Player_Cube”.
This is only a placeholder.
I deleted that branch, and connected it as you said (I think I had this done in the past too, but I was just trying things now). It shows AIR only at the beginning, because on start it is falling a few meters. Then it hits the ground, prints GROUND, and keeps printing only GROUND. When falling it doesnt print AIR again.
I see here he’s falling but still leaving tire tracks or is it the perspective?
So it is working…I suggest you try on a level with simple ramps (triangles, boxes, planes) to test this out, then move to custom more complex terrain.
Its just the perspective, the tracks are a simple particle system and they keep spawning regardless if its in the air or not; those are not the issue (yet )