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 Relative Transform in Construction Script breaks attachment

I have a Blueprint class with a static mesh component attached to the DefaultSceneRoot. When I create an instance of the Blueprint and move it around in the scene, the mesh that is part of it moves as well. (This is correct, and desired.)

When I add Blueprint code in the Construction Script that calls Set Relative Transform on the static mesh, it does the right thing (properly scaling and translating the mesh as desired, based on variables in the blueprint) but it breaks the attachment to the DefaultSceneRoot. When I translate the instance after hooking up the Construction Script, the static mesh remains in the same spot, no longer moving with the rest of the blueprint.

How can I use the Construction Script to change the scale and location of a mesh component that is part of the blueprint, and still retain the ability to move that mesh around by moving the blueprint instance itself?

alt text

Product Version: UE 4.18
Tags:
more ▼

asked Mar 05 '18 at 02:15 AM in Blueprint Scripting

avatar image

Gavin.Kistner
169 7 13 24

avatar image Gavin.Kistner Mar 05 '18 at 02:23 AM

If there is a more elegant way to set the scale, or to use a pivot offset so that the mesh is always stuck on the ground, I'm also interested in such comments.

avatar image phisigma Mar 05 '18 at 01:24 PM

Sorry, I could not reproduce the behaviour you described. The attachment to the DefaultSceneRoot is not broken by the construction script.

avatar image Gavin.Kistner Mar 05 '18 at 01:33 PM

Here's what I experience:

  1. Remove the construction script, select the blueprint instance, use the move to to drag it, watch the static mesh move, too.

  2. Add the construction script, adjust properties of the blueprint instance, see the static mesh resize (Yay!) but now use the move tool and the billboard sphere for the blueprint moves, but the static mesh stays at the origin.

avatar image Gavin.Kistner Mar 05 '18 at 05:08 PM

Thank you for testing. As I replied below, I too cannot reproduce this behavior with the same project files on a new machine (running Windows vs. OS X). Not sure what was going on, will have to investigate more when I get home tonight.

avatar image sboochoon Mar 05 '18 at 02:32 PM

I also couldn't reproduce your issue.

Here is a more elegant way to get the mesh to stick to the ground (provided that the pivot is at the center) alt text

avatar image Gavin.Kistner Mar 05 '18 at 05:02 PM

Really helpful, thanks. FWIW, I tried running my project on Windows instead of OS X and the editor works as expected on Windows. I'll close the question for now, and re-open once I can confirm that the behavior is broken. :p

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I cannot reproduce the issue at work, either (using 4.18.3 on Windows versus OS X). I'm going to say that either the editor was in a bad state, or something is broken on OS X. I'll confirm when I get home.

(I'd just delete this question, but @sboochoon's useful comment seems like I should leave the question up for others.)

Edit: FWIW, yes, the Editor was just in a bad state. When I closed and re-opened the project, the unexpected behavior was no longer reproducible.

more ▼

answered Mar 05 '18 at 05:07 PM

avatar image

Gavin.Kistner
169 7 13 24

(comments are locked)
10|2000 characters needed characters left
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