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 limit the value of add local offset

I am making a crane that can be extended/retracted, but I want to limit how much it can be extended/retracted, so the tubes wont fall out of it's parent tube, please let me know how to do so.

alt text alt text

I have attached my blueprint on how to control the extension of the tubes, its a stupid method that I came up with, feel free to correct me if there are simpler and better way to do that as well, thanks a lot. alt text

Product Version: UE 4.19
Tags:
bp.jpg (275.3 kB)
0.jpg (140.9 kB)
1.jpg (152.2 kB)
more ▼

asked Dec 11 '18 at 04:14 AM in Blueprint Scripting

avatar image

jasoncwf
1 1

avatar image HarryHighDef Dec 11 '18 at 01:12 PM

Why not use set local offset and use a clamp node?

avatar image Tuerer Dec 11 '18 at 01:19 PM

Might work. Counterquestion to you: what if a component is driven by force, not by functions? Is there a way to limit its movement other than by putting a blocking volume where it should stop?

BTW, @jasoncwf, you can create blocking volumes one for each tube, and tick the sweep box when offsetting. It will require setting different collision presets for different tubes.

avatar image HarryHighDef Dec 12 '18 at 03:00 PM

For the forces you can look at physics constraints. They allow you to set linear offset limits.

avatar image Tuerer Dec 12 '18 at 05:27 PM

Thank you. That really did the job limiting a component's movement.

avatar image jasoncwf Dec 18 '18 at 08:16 AM

Thank you very much, I will give it a try when I have the chance :)

avatar image Slavq Dec 11 '18 at 01:13 PM

Try something like this:

alt text

ah11.png (617.8 kB)
avatar image alefaso Dec 11 '18 at 01:21 PM

You could add a conditional branch, and check if the offset is less of the max-offset value then the crane extends when the user gives the input, otherwise if the crane offset is >= of the max-offset value then nothing happens. You could use variables to set these values or just use float/int nodes.

avatar image jasoncwf Dec 18 '18 at 08:17 AM

Thank you very much, I will give it a try when I have the chance :)

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

1 answer: sort voted first

Edit: I've posted this before my first comment, but it went through moderation queue and appeared only now, so sorry for double. But I think I can leave this as an answer too.

The best solution depends on the rest of your system, but the first thing you can try is to use the Clamp node before the Delta Location Z inputs:

OffsetLimitHelp

This way you can limit your offset for both negative and positive values, using the Min/Max inputs.

ah11.png (617.8 kB)
more ▼

answered Dec 12 '18 at 02:41 PM

avatar image

Slavq
1.9k 151 149 201

(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