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"

Stop Rotating Button When Blueprint, Mesh Is Rotated?

I have a Blueprint with a Static Mesh, which has buttons components attached to the item.

I rotate the item in real time, so players can set objects in the game. (Please see screenshot) But I am trying to NOT ROTATE the buttons, so they are always showing to the player (Top Down Screen).

How would one setup buttons on a Blueprint, (for a Top Down Game), when players rotate the object. The buttons are not rotating with the object?

Thanks Markus

alt text

Product Version: Not Selected
Tags:
more ▼

asked Jul 24 '14 at 07:07 PM in Blueprint Scripting

avatar image

DreamBotStudios
146 32 48 54

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

2 answers: sort voted first

Are these buttons a child of the mesh? Normaly a child rotates with his parent at some point.

If it's only Top Down, you should just get the Button and set it's rotation to a fix value that points upwards. You can also calculate the direction from the position of the button to your character or camera.

If i remember correctly, you need to get the world location of the button and of your character, subtract the button position from the character position and use the 'x' value of that outcome for a rotation. This x value thing is just breaking some vector nodes and using the axis alone, than "Make rotation from X" and plug it back in.

That setup should always point the button in your direction. But it could be, that you only need the fix value. I don't know your exact gamesetup.

more ▼

answered Oct 03 '14 at 11:17 AM

avatar image

eXi
6.8k 333 185 470

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

Essentially, the issue is that your buttons are components of the actor, so they rotate with it, as you'd expect. What you really want is to keep your buttons at a constant world-oriented rotation, rather than a constant local rotation, if I'm right. This is fortunately quite easy to do. In your construction script (or on tick if the object needs to rotate during gameplay), you can use the SetWorldRotation node on the buttons, which sets their rotation irrespective of their parent's rotation. If you set this to a constant value (or some other calculated value that doesn't include the actor transform), then the buttons will stay in the same rotation as the blueprint rotates.

If the buttons are not positioned locally at 0,0,0, though, they may move around as the parent rotates, but you can do a similar thing with the SetWorldLocation node in blueprints, only this time, you'd need to use the actor location (but not rotation) to ensure the buttons move correctly with the blueprint,

more ▼

answered Oct 03 '14 at 11:09 AM

avatar image

Hoeloe
388 41 46 60

(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