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"

Reproducible Bug: SetRelativeLocation on a component sets the world location if the component is simulating physics.

I have a skeletal mesh that is parented to a Scene component in an actor blueprint: alt text

My skeletal mesh component is set to not simulate physics, and I call its SetRelativeLocation(AndRotation) with all zeros every tick for this actor. I have a key press set up to toggle the component's physics simulation. The actor it belongs to is at a non-zero world location. When I run my game, the skeletal mesh is where it is supposed to be, sharing the location of the owning actor. When I press my key that toggles whether we are simulating the skeletal mesh's physics, the component teleports to world location 0,0,0. If I press my toggle key again to turn physics simulation off, the component does not return to relative location 0,0,0, but rather stays at the world origin.

I am able to reproduce this in a fresh 4.12 project, using a Static mesh instead of a skeletal mesh this time. Here is my blueprint for the actor: alt text

Here's a link to my test project: https://drive.google.com/file/d/0B3u_hzolRrMjdXNiMUc3LW1PbHM/view?usp=sharing

Please let me know if you'd like any more information about my setup.

Product Version: UE 4.12
cap3ty4tture.png (137.3 kB)
more ▼

asked Sep 29 '16 at 08:14 PM in Bug Reports

avatar image

437 20 97 123

avatar image janimationd Sep 29 '16 at 11:17 PM

I've added a test project in the description in which I've been able to reproduce this issue.

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

1 answer: sort voted first

Hey janimationd,

This is actually by design. The reason is that any object that simulates physics will detach from its parent. Physics simulation takes space in World Space, which is why it would set the world location of the object.

Have a great day

more ▼

answered Sep 30 '16 at 01:04 PM

avatar image

Sean L ♦♦ STAFF
43.5k 485 152 443

avatar image janimationd Sep 30 '16 at 04:04 PM

Huh, that's interesting. After this occurs, does the object retain any reference to its parent object? If I turn physics back off for the object it doesn't snap back to its parent object reference frame.

avatar image Sean L ♦♦ STAFF Sep 30 '16 at 04:48 PM

I believe this is intended as well as it detaches from the parent upon simulating physics. Might be worth trying to reattach it after disabling simulate physics using something like an AttachTo(), but this could potentially lead to some undesirable behavior.

avatar image QTheTaxpayer May 24 '19 at 04:51 PM

I mean, I can understand not wanting to deal with parenting when you're also simulating physics -- there are conflicting assumptions about how those should work. But if you don't want to allow it... you shouldn't allow it. It's confusing to allow two features to be used together if you're just going to (permanently?) break one of the features when it happens, especially since this doesn't seem to be documented anywhere. Why not throw an error instead?

Also, I'm hitting an issue where I have a parent component with physics, and when I try to attach a child component to it and set the child's relative location, the child's absolute location is set instead. Is that a related bug?

(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