AddForce/AddImpulse won't work
I've created a Pawn class in C++, added a Mesh component and set physics simulation to true, as well as defining a physics profile to the Mesh (When I skipped this part, gravity wasn't affecting the object). I used "Pawn".
Now, I'm trying to AddForce on the Tick function, but don't matter how big I make the force vector, the mesh simply won't move.
The object is falling when I hit play, which means physics are being simulated, but Force/Impulse doesn't get applied. I tried this both with Blueprints and C++.
When I use SetLinearVelocity, it works, but then gravity doesn't affect the object.
I'm having a lot of issues with Physics with Unreal. Hope someone can help me out with this.
Here is my constructor code:
And here's the Tick function:
Pretty basic stuff which should be working fine, I think.
Well, if someone can give me a hand with this, I'd really appreciate.
asked Aug 25 '15 at 09:23 PM in C++ Programming
answered Aug 25 '15 at 09:46 PM
Hi Thomas, I have a similar problem, I want to set velocity to my character, I have tried Mesh->SetLinearVelocity() and Mesh->AddForce(), I have followed your code, but still no motion, do you know why?
answered Mar 09 '17 at 03:05 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here