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"

Set Simulate Physics and AttachActorToComponent Problem

Something seems to go wrong when trying to use Physics on an Actor and then trying to attach it to another's mesh. In my case, I have an Actor where I set the "Set Simulate Physics" to true in the construction script. At some point I try to "AttachActorToComponent" the mentioned Actor to the Mesh of my Character Blueprint (at a particular socket in the mesh), and nothing happens. However, if I remove the "Set Simulate Physics" to false inside the construction script, everything works fine. Further, I try to disable "Set Simulate Physics" right before the "AttachActorToComponent" call, but it still doesn't work - In other words, if i set "Set Simulate Physics" to true, even if it's only once, I can never get the target Actor to attach to the component.

All of the above was done in blueprints.

Product Version: UE 4.8
Tags:
more ▼

asked Jul 27 '15 at 06:58 AM in Bug Reports

avatar image

hardballs
23 8 12 14

avatar image Daeftan Nov 27 '15 at 01:37 AM

I wanted to bump this since this is such an important issue. It took me several hours to find this very simple fix. Thanks alot, TJ!

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

1 answer: sort voted first

One thing to remember is that you should never try to use physics calls and translate calls in the same frame. This goes for attachments and enabling/disabling physics too.

What you're doing is fine, just wait a frame after you disable physics before attaching the actor.

more ▼

answered Jul 27 '15 at 04:38 PM

avatar image

hyperdr1ve
593 28 51 118

avatar image hardballs Jul 28 '15 at 02:30 AM

I used a Delay node set at 0.5 and it did not work.

avatar image TJ V ♦♦ STAFF Jul 28 '15 at 03:18 PM

Hi hardballs,

Could you post some screenshots showing us your blueprint setup?

avatar image hardballs Jul 28 '15 at 05:19 PM

I attached my construction script for an Item, which is where is set simulate physics to true. Inside the character blueprint, once a client presses a key, it will disable the simulate physics and do other logic.

item.jpg (394.8 kB)
char.jpg (435.4 kB)
avatar image TJ V ♦♦ STAFF Jul 28 '15 at 06:45 PM

The main issue has to do with your Component hierarchy for the Item blueprint. When you set the Body to simulate physics the root stays where it was placed. When you pick the item up it is the root of the blueprint that is attaching to the player.

I suggest making the Body the root component (or an invisible dummy component) and your setup will work fine.

avatar image hardballs Jul 29 '15 at 03:39 AM

TJ, I can't thank you enough for your input. This also fixed other issues I was having in my object inheritance hierarchy - I had some hacks cooked up to patch them up.

Apologies for the mistake.

(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