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"

Local Offset Keeps Moving Mesh

When you add a local Offset to a Mesh in the construction script every time you compile it will add to the offset. When you look in the view port the mesh will be really high until you close and reopen the BP.

Do you know of anyway to prevent this from happening?

Thank you. John

Product Version: UE 4.21
Tags:
more ▼

asked Nov 20 '18 at 02:06 AM in Blueprint Scripting

avatar image

JohnADaniels
75 4 6 9

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

1 answer: sort voted first

Use SetRelativeLocation instead of AddLocalOffset or use AddLocalOffset but in BeginPlay

more ▼

answered Nov 20 '18 at 08:19 AM

avatar image

Hustlan
345 4 4 12

avatar image JohnADaniels Nov 20 '18 at 03:03 PM

Thank you Hustlan for the information. I had tried the SetRelativeLocation but since these are being spawned the Z is correct but it will spawn the X and Y at 0 0.

Adding AddLocalOffset but in BeginPlay does work even when spawning but it causes the spawning to be inconsistent, like you will click the button to spawn and it sometime will spawn and sometimes will not spawn, if you click the button 3 or 4 times it will finally spawn with correct offset. Once I changed it back to the construction script they all spawn perfectly.

I will have to keep the offset in the construction script for now, I guess it is a glitch that it keeps adding to the offset each time you compile unless you close and reopen.

avatar image Hustlan Nov 20 '18 at 03:55 PM

It's not a glitch, construction script in blueprints fires every time you compile them or move their instances on the level to provide you the correct results.

As for SetRelativeLocation, you shouldn't pass there the same values from AddLocalOffset, you should first use GetRelativeLocation, add the value you used in AddLocalOffset and then pass the result into SetRelativeLocation.

avatar image JohnADaniels Nov 20 '18 at 06:53 PM

Thank you again Hustlan, I appreciate your help! With you help I ended up in the Construction Script doing the following:

Construction Script > SetRelativeLocation X0 Y0 Z0 > AddLocatalOffset X0 Y0 Z60

Now when you compile it will move the mesh back to 0 0 0 and then from there it will set the offset, this keeps it from adding offset each time it is complied.

Thanks again for your help.

(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