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"

Please help!

I'm following this guide.


I'm trying to get it to work for a rectangular block rather than a cube. But once the block is straight up in the air, it clips through the floor.

Any ideas?

Thanks in advance!

Product Version: UE 4.8
more ▼

asked Aug 15 '15 at 03:08 AM in Blueprint Scripting

avatar image

16 3 6

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

1 answer: sort voted first

You will need to add an offset into your rotate around vector axis based on the height above the ground. if lying down, use small offset, if standing up use larger offset. This could also be calculated by working out the distance from the actor position to the "ground"

Can you send a screenshot of the blueprint where it rotates?

more ▼

answered Aug 15 '15 at 07:08 AM

avatar image

986 34 3 41

avatar image mastergrief Aug 16 '15 at 12:59 AM

This handles the animation, the math for the movement, and the timer to prevent the player from triggering the animation while its already playing

avatar image mastergrief Aug 16 '15 at 01:04 AM

Its actually handled in a few parts. The function I posted, called "Move Tween" is responsible for animation and rotation. This function, called "pivot" is responsible for the calculation of offset. "pivot" is pictured below. alt text

capture.png (116.6 kB)
avatar image mastergrief Aug 16 '15 at 01:09 AM

I supposed my question now is, how would I be able to get a condition based on whether the block is stand up or lying down.

avatar image MrGrr Aug 16 '15 at 02:31 AM

In your pivotpoint function - the "Make Vector" has a set height of Z -50. Test changing that to make sure it pivots at different heights.

What to do next is a line trace for objects straight down, break the hit result and return the length, use the Length output to determine the Z for "Make Vector" then it should always be at the right height

avatar image mastergrief Aug 16 '15 at 03:06 AM

Quick question, how do I get length of the line from the "break hit result." Is that the "normal" pin?

avatar image MrGrr Aug 16 '15 at 03:24 AM

take the actor location vector, subtract the Location, feed the result into a "VectorLength" you will get a float with the distance between the two.

avatar image mastergrief Aug 16 '15 at 03:54 AM

I cant get it to work, Im sure I messed up. Here take a look(From Pivot Function)alt text

Thanks so much for all you help! (Event Tick from the block object)

alt text

capture2.png (122.5 kB)
capture3.png (155.2 kB)
capture2.png (122.5 kB)
capture3.png (155.2 kB)
avatar image MrGrr Aug 16 '15 at 07:13 AM

on the second picture (capture3.png) you have location and get actor location doing some subtraction, basically drag off the output pin of the subtraction and type vectorlength and it should tell you the length(in the case the Z offset) you need to feed into the "Make Vector"

you dont need the Break Vector you have listed in the pivot

avatar image mastergrief Aug 16 '15 at 12:42 PM

I think we are almost there, the object just keeps adding the length from the ground, so it climbs rather than correcting the depth. https://answers.unrealengine.com/storage/temp/54372-capture5.png https://answers.unrealengine.com/storage/temp/54371-capture4.png

It keeps climbing rather than dynamically switching between z=-50(for laying down) and z=0(for standing up)

The vector length is also returning a value much higher than what is needed (ranges from 107 to 138 on first button press).

capture4.png (91.1 kB)
capture5.png (138.8 kB)
avatar image MrGrr Aug 17 '15 at 09:10 PM

another option.... just use the returning float to trigger a bool...

comparefloat input: vectorlength compare with 110

set Z float to 0

< set Z float to -50 or some variant, it'll just be the math to get that accurate position everytime
(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