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"

Rotating Movement Component Question

Hey all,

So I have these balls that fall down in the level and the player taps them to break them. I am trying to make another version of these that "wobble" as they fall. I tried using a rotating movement component with a pivot offset but collision detection is disabled while this component is active. I tried using an lerpto component but then the balls simply wont fall. Does anybody have an idea for a workaround, or is Epic planning on ever adding collision to the rotating movement component? I'll also note that physics isn't simulated on the balls, they use a projectile movement component to get fired out of spawn and then bounce off the walls and each other as they fall.

Any ideas could help.

Thanks!

Product Version: UE 4.8
Tags:
more ▼

asked Jul 23 '15 at 04:12 PM in Blueprint Scripting

avatar image

LordTorsten85
43 5 7 15

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

1 answer: sort voted first

Hello @LordTorsten85,

I think I have a pretty good solution for you.

I will show my code and explain it below.

alt text

Essentially what I am doing above is creating a vector to add to my projectile component's original velocity in the Tick event in the Blueprint containing my projectile component. I then set the projectile component's velocity to this newly created vector. I create the vector used to update the velocity by using the Sine function to oscillate from -1 to 1 and the multiply that value to the Right Vector of the actor to make a vector with a left to right direction. I control the value coming from the Sine function by multiplying values before and after it. One of these values control the speed(frequency) of the wobble and the other controls the amount of wobble(i.e.the distance the object travels during the wobble).

Side Note: You can use any directional vector in place of the "Get Actor Right Vector" node. For instance you could use the "Get Actor Up Vector" node to make the projectile wobble up and down.

I hope this answer helps you out,

Farshooter

wobble 1.png (97.6 kB)
more ▼

answered Jul 24 '15 at 12:01 AM

avatar image

BitBoy92
488 53 38 57

avatar image LordTorsten85 Jul 25 '15 at 03:58 AM

Thanks! That did it, for the most part. I had to do some modifications because the balls are spawned with a random velocity at the start, and if I spawned them this way they would just move back and forth and not fall. It had the same effect as the LerpTo component but it gave me a little more control. I ended up adding a rotating component and adding in the down vector to shoot it off in random directions with a much smaller wobble. It still needs some polish, but it was good enough to put in for testing.

I appreciate your input! I think I'll be hopping back on Kahn Academy this weekend to keep working on my vector math.

Man I wish I paid more attention in math in school...

Thanks!

-Trevor

(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