Getting rotation and set location to work with simulated physics
In my script, I have an actor that when colliding with the player, will check if certain requirements are met and if they are, they move into the player to be consumed (deleted). If they aren't. a basic physics simulation takes place and they are knocked away.
When I attempt to do this with
I have tried enabling and disabling physics as collisions take place but if I have
Is there anyway to get around this or fix this? Thanks in advance. I would post my blueprints but they are a bit messy and quite long at the moment.
asked Jul 25 '15 at 11:43 AM in Blueprint Scripting
Hello @ReallyGoodPie ,
I found two solutions for you that will both work when simulating physics.
The first solution is to apply the rotation directly to your static mesh component in your actor Blueprint. As you can see below I use the "CombineRotators" node to create a new rotation for my "Cube" static mesh ever frame making it spin.
The second solution is to use the "Add Angular Impulse" node on your static mesh rotate it by physically applying impulses. I prefer this solution more because I think it is a little less hacky than the first solution and leads to more realistic behavior.
I hope this answer helps,
answered Jul 25 '15 at 05:57 PM
How do you get the rotation of the physics body? I can rotate my physics-enabled actor with thrusters, but get rotation is returning zeros. If I collide and get spun around, I've no idea which way the actor is pointing
answered Sep 06 '16 at 07:13 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here