Rotating Movement Component Question
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.
asked Jul 23 '15 at 04:12 PM in Blueprint Scripting
I think I have a pretty good solution for you.
I will show my code and explain it below.
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,
Follow this question
Once you sign in you will be able to subscribe for any updates here