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"

How to scale an actor to match another actors bounds

Hi, I'm new to UE4 and am hoping someone can help me get past this blocker.

In my example I have an actor in the foreground - it could be a chair. In the background there would have a plane that lines up perfectly with the bounds of the chair. This would update on tick, so that if the chair were to rotate, then the plane would rescale accordingly.

I am thinking that you would need to draw an imaginary box around the chair to get the boundary coordinates, and then combine with the distance of the plane from the chair to scale accordingly. If this is the right way to go about it I have no idea.

Images attached should demonstrate the intention clearly - white area is the plane, black is the rest of the scene.

Thanks

Addendum: I am more interested in recreating this effect, than trying to force the specific solution I gave above - e.g. UMG/post-processing/etc are all valid routes.

alt text

alt text

Product Version: UE 4.18
Tags:
chair1.png (322.7 kB)
chair2.png (164.4 kB)
more ▼

asked Jan 30 '18 at 12:43 PM in Blueprint Scripting

avatar image

thyrf
1 2 3

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

1 answer: sort voted first

For anyone trying to achieve the same outcome - I managed to get the result above, but through a totally different method.

I ended up removing the plane entirely and using a LineTracer to sweep inside the sphere radius of the target mesh - once from each direction - until a collision was detected. This value was then projected to screen space and passed to a UMG border blueprint that altered its size. My thoughts were that by using a 2D, screenspace solution it wouldn't be tripped up by pivot locations, scale, rotating, transformations, etc.

It works very well and with any mesh.

more ▼

answered Feb 02 '18 at 02:40 PM

avatar image

thyrf
1 2 3

avatar image Nocte Studios Aug 26 '18 at 10:26 PM

Hello, nice to hear you find out the solution. I have a situation something like this. In my case; let’s say there are two cylinders. One of them bigger then the other one and the smaller one is inside of it. I need to scale the big one until it hits to smaller mesh in every position. For example if the left side’s distance is more than the right side, then it has to scale faster from left side. Can you help me with that?

(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