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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Modify Angular Rotation Offset at Runtime

Is it possible to modify the angular rotation offset of an physics constraint at runtime with blueprints ? If not, is it possible in C++ ?

Thank you.

alt text

Product Version: Not Selected
Tags:
more ▼

asked Jan 16 '15 at 05:23 PM in Blueprint Scripting

avatar image

Sprawl
35 6 7 9

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

2 answers: sort voted first

Hi Sprawl,

No, it is not possible in blueprint, because this property uses only during constraint initialization. In C++ you can setup this variable and call UpdateConstraintFrames or InitComponentConstraint, but it can lead to some performance problem (if do it every tick).

Best regards, Gleb

more ▼

answered Jan 19 '15 at 04:23 PM

avatar image

Gleb.Bulgakov
1.8k 76 19 143

avatar image Sprawl Jan 19 '15 at 11:30 PM

Thank you for the answer ! It is really appreciated.

If this is the basis of my gameplay and only one object is calling it every tick, do you think it will have a significant impact on performance ?

avatar image LazyMammal Oct 14 '15 at 10:35 PM

I made a doorway blueprint that uses a Physics Constraint to stop the door from opening too wide.

But I also exposed a public variable for StartingAngle. The BP Construction script sets the rotation angle of the door. This way I can use the same BP for doors that are either initially closed or partway open.

The problem is the physics constraint seems to be applied after the Construction Script rotates the door. So it ends up not closing (and opening too wide).

I either need 1) access to the Angular Rotation Offset in the BP Construction script or 2) a change in the behaviour of Physics Constraints so they respect the original position of the door prior to its rotation in the BP Construction script.

Maybe there's another way to rotate the static mesh that I'm not aware of.

Any help would be appreciated.

avatar image Weibye Feb 26 '18 at 11:11 AM

I'm currently attempting creating the exact same blueprint as you, and encountered the same problem. Did you ever figure out how to solve it? Or an alternative work-around?

avatar image Shrekleton Mar 07 '18 at 12:32 PM

I would like to know this as well, as I am attempting the exact same thing and encountering the same problem. Edit: Ok the simplest (Blueprint) work around that I found and works for that is just to have a StartingAngle variable like LazyMammal described, and use that to rotate the door with AddRelativeLocation in BeginPlay, (so after the constraint has been initialized). Obviously it's not the greatest solution, there is unfortunately no 'preview' in the editor of your angle unless you create a seperate HiddenInGame mesh for that as workaround for example. What works better for me, in C++, is doing combining cin and gleb's answers and modifying the AngularRotationOffset like this, in BeginPlay:

     PhysicsConstraintComponent->ConstraintInstance.AngularRotationOffset -= FRotator(0.0f, DoorMeshComponent->GetRelativeTransform().Rotator().Yaw, 0.0f);
     PhysicsConstraintComponent->InitComponentConstraint();

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

constraint->ConstraintInstance.AngularRotationOffset = FRotator(0, 90, 0);

more ▼

answered Jun 28 '16 at 09:57 PM

avatar image

cin
16 3 4

(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