Hey people. Had a smooth 2 months without any problems, but here we are once again - this time, a problem with physics simulation.
We have these stairs in the game, that need to be moved around. The character cannot jump, so they are extremely important. Followed a tutorial by Tesla, and got it to work pretty well! (here’s the tutorial : https://www.youtube.com/watch?v=OltZ-xFz8IQ)
So now we could move the stairs around the room. Next, we adjusted a few things :
Linear and Angular damping were increased, to add some friction with the ground. We want the object to stay in one place as soon as it’s released (since there’s carpet below it, it shouldn’t slide the way it initially did). We also locked the Z position, since the object shouldn’t go up and down at all - it’s in the right height. We also locked the X and Y rotations, to avoid the object being rotated in a weird way, that would make it impossible to use the stairs.
Here’s an image of the object to get a better idea :
The idea is, that the player can pick up these stairs and move them around the room, so he can open the drawers near the ceiling, and escape into the vent in the end.
At this point, we could grab and release the stairs (this worked perfectly), and the constraints worked perfectly too - no weird rotations, and they stay in the same Z transformation! Next, we decided to fix the collisions - we wanted the stairs to have no collision with the pawn while they’re being moved around. This would fix any weird ‘stairs-hit-player-and-send-him-to-space’ issues. Managed to do that as well :
(This is the stairs blueprint)
Now, here’s where the weird part comes. Let me first post screenshots of the whole set-up. First Person Character’s Blueprint :
Where the tutorial ends, we added the part in the event tick picture - the one with the mouse. Since our X and Y rotations are constrained, we wanted the mouse’s X position to control the Z rotation of the stairs, but only if Shift is pressed as well. For some reason it won’t work however… I press shift, and move the mouse, but the objects acts as if I’m not doing anything. I thought it could be the angular damping, but even if it’s on 0, the same behavior happens. The object will simply not rotate. It might be some of the constraints I’ve set up (that’s why I’ve posted everything to do with this problem), but I have no idea if I’m doing it wrong or not… Any help would be very welcome! Thanks!
Also, I would like to add something to the code, and I have no idea where and how to. Right now if I release the stairs, the collision is set to block the pawn, resulting in weird interactions. Here’s what I’d like to happen :
If the stairs are overlapping with the character upon releasing, they should ignore each other until they are no longer overlapping. Once they are no longer overlapping, they should block each other. Any thoughts on that too?