x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Simulate Physics and Projectile Movement Component

I have a Grenade which uses a UCapsuleComponent and a Projectile Movement Component together. If I turn off the Simulate Physics and Enable Gravity off it traverses its expected path.

alt text

The only issue we have with the Grenade is it should rotate when we throw it or when it hits e.g. a wall or ground. But the rotation of it keeps resetting to its original rotation (when it hits a wall it rotates but immediately resets to its original rotation, compare the above pic with the following). If we enable Simulate Gravity it starts spinning and rotates when it hits a wall. If we enable Simulate Gravity before activating the Projectile Movement Component it immediately falls through the ground. But, if we first activate Projectile Movement Component first then enable Simulate Physics it partially works (and sometimes it falls through the ground). It traverses parts of its path and then falls and spins.

alt text

If I disable gravity on the Collision component and set the Gravity Scale to zero on the Projectile Movement Component it travels through a straight line through space and never falls off. How can I have a spinning grenade with a Projectile Movement Component?

Product Version: UE 4.18
Tags:
more ▼

asked Dec 17 '17 at 12:58 PM in C++ Programming

avatar image

NuLL3rr0r
27 5 8 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Projectile movement component and simulate physics are incompatible. You have to pick one or the other. If you want to use physics then get rid of the projectile movement component and use other means of imparting the forces onto the grenade. For example, you can use "Add Impulse".

Projectile movement is good for bullets. If you want a good grenade, you should use physics IMO.

more ▼

answered Dec 17 '17 at 05:38 PM

avatar image

Jin_VE
4.4k 32 77 42

avatar image NuLL3rr0r Dec 18 '17 at 06:16 AM

Thank you so much for the clarification. I think I'll go with the physics and remove the projectile as it makes more sense.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question