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 a staticMeshComponent/actor in his local axis using Blueprint.

Hi everyone !

I've already asked how to move an actor in his local axis, now I would like to know how to rotate a mesh component, or an actore, in his local rotation axis.

For example, I have an asset, that I want to place multiple times in my level, in different location/rotation, every time I press a button on my controller it rotate each of them by 45 degrees in their local axis (lets say the local Yaw axi).

Using blueprint I can't find a way to do that, it's always in world space or parent space, I know I need to get a variable of the actor rotation at construction time, but how would you multiply only one local axi to make it rotate ?

As usual I' m sure it's simple, but I can't find the solution ...

Many thanks !

Product Version: Not Selected
Tags:
more ▼

asked Aug 21 '14 at 08:45 PM in Blueprint Scripting

avatar image

Calemike
46 12 12 19

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

2 answers: sort voted first

Hi Calemike,

Take a look at this example below.

Create a Variable in the Construction Script that Sets the Relative Rotation of the root component.

alt text

To be able to add to the rotation you will need to Break the Rotation > Add to Yaw > then Make the Rotation again. Set the Variable again after the move so you can keep pressing the button and it will keep adding to the rotation.

alt text

more ▼

answered Aug 21 '14 at 10:05 PM

avatar image

TJ V ♦♦ STAFF
41.1k 1009 183 493

avatar image TJ V ♦♦ STAFF Aug 21 '14 at 10:05 PM

Make sure to Disable Input Key on which ever key you use.

alt text

avatar image Calemike Aug 21 '14 at 10:36 PM

Hi Ballard,

Thanks for your reply, I just get it to work then you posted your answer :) Good thing is your solution is different than mine and can help later on my project !

Here is how I manage to do it.

I forgot to explain that I need to rotate this mesh depending on the axi value I get from the controller triggers.

Before I had only the mesh component in my BP; I added a child node as parent.

alt text

Then, before I used to do like you said, in the construction graph, getting the actor rotation as a variable to reuse in the graph. But I end with this.

alt text

Using the relative rotation was not working when the mesh was the only object in my blueprint, but parenting it to something else make it work!

Anyway, thank you for the reply, I appreciate :)

Cheers.

componentsue4.jpg (63.6 kB)
blueprintue4.jpg (294.4 kB)
avatar image TJ V ♦♦ STAFF Aug 22 '14 at 12:54 PM

You're welcome. I'm glad it will be of some help. Good luck on your project!

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

Found the way to do it :)

If someone is interest to know how let me know I'll explain :)

more ▼

answered Aug 21 '14 at 09:58 PM

avatar image

Calemike
46 12 12 19

avatar image TJ V ♦♦ STAFF Aug 21 '14 at 10:07 PM

Sorry, you must have answered while I was typing this up. Anyways, glad you figured it out.

avatar image CloudMonster Sep 16 '15 at 11:54 AM

how can you select multiple objects in the view port then rotate them on their individual center points?

(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