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"

Can still rotate object after releasing it

I have a physics handle set up, which can grab an object and release it, when i press "G". However, after i release the grabbed object, i can still rotate it, no matter where the object is.

How can i stop the rotation after releasing it?

Here are some screnshots: alt text

alt text

alt text

alt text

Product Version: UE 4.14
Tags:
1.jpg (265.9 kB)
2.jpg (248.4 kB)
3.jpg (266.4 kB)
4.jpg (171.0 kB)
more ▼

asked Feb 25 '17 at 12:35 PM in Blueprint Scripting

avatar image

ggez27
3 1 3 2

avatar image MadMarsza Feb 25 '17 at 07:38 PM

This should be working I can't figure it out.Try using another "Branch" for condition "HoldingObject" Variable between the "set target location" node and the "Branch(Holding RMB)" node in your event tick.Also check that Ur Variable "Holding RMB" is correcty Set since I don't see you changing if it is active or not.

avatar image ggez27 Feb 25 '17 at 07:45 PM

Hey there! Thanks for your answer, i didn't set the RMB down correctly, so i had to disable the input after it was released. But now, i got another problem. Is there a way to stop the rotation of the object when im grabbing it? E.g. the object is rotating as im grabbing it, and it doesnt stop rotating. Is there a way to stop the rotation, when i grab the object? Even when i rotate it, the rotation does not stop. How can i do this?

avatar image MadMarsza Feb 25 '17 at 08:17 PM

Can I suggest a slightly different way of doing it,Please have a look at my BP and change yours to work in the same way,This should be exactly what you want to do.To change the rotation speed adjust your X and Y from -5000 to -7000 or so.Please let me know if this works for you. alt text alt text

object rotation.jpg (196.7 kB)
mouse input.jpg (158.9 kB)
object rotation.jpg (196.7 kB)
avatar image ggez27 Feb 26 '17 at 12:12 PM

Hey, so i tried both BPs, (yours and mine) and i noticed that mine was rotating much smoother with the axis values from the player input (turn and lookup). But i actually meant something different. I meant that, when grabbing a object that is rotating, the rotation doesnt stop. I made a short video for you: https://www.youtube.com/watch?v=gfZ6T9sfg0w[link text][1]

I want the object to stop rotating after i grab it.

[1]: https://www.youtube.com/watch?v=gfZ6T9sfg0w

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

3 answers: sort voted first

Okay if I understand correctly is the item never stops rotating by itself when you pick it up.In your Blueprint under 'set location and rotation of targeted object by linetracebyhitchannel' change the "add local rotation" node to "set relative rotation"

This means instead of just adding to the actors current rotation it will actually change the rotation,but only while holding RMB so when you are not holding RMB it wont change the rotation,meaning your item will not rotate unless you are rotating it

more ▼

answered Feb 26 '17 at 02:06 PM

avatar image

MadMarsza
22 3 3 6

avatar image ggez27 Feb 26 '17 at 02:46 PM

Thank you! So, i changed that node to "set relative rotation", got the mouse position scaled by DPI and connected it to the rotator on the "set relative rotation". Everything works fine. But! There's one little thing that i want to fix. When i rotate the object and release the RMB, the object continues with the rotation that i picked up.

So it's like this: 1. Object is rotating - and i grab it, it continues rotating. 2. When i rotate it with my RMB, it takes my rotation. 3. When i release the RMB, it continues with the rotation, with that i picked it up.

I want the object to completely stop rotating when i pick it up, and only to take my rotation that i input. I tried various things, but all ended up not working. I could send you more screenshots of my Character BP if you want.

avatar image MadMarsza Feb 26 '17 at 03:01 PM

Please send me all the BP's yea I will set it up in a project and let you know what I can find out

avatar image ggez27 Feb 26 '17 at 03:17 PM

Here are all my BPs. See if you can make something out of it. I would be very thankful. (Btw. the cubes or objects have no BPs. They just have the "set simulation" tick, set on.)

link text

avatar image MadMarsza Feb 26 '17 at 05:30 PM

Okay I duplicated your project and I can see the problem,I will let you know when I have a solution

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

Tested and works,just add this one branchalt text

more ▼

answered Feb 26 '17 at 06:05 PM

avatar image

MadMarsza
22 3 3 6

avatar image ggez27 Feb 26 '17 at 06:48 PM

Hey mate, i added that node, but unfortunately... it didn't change anything? Did you change something other in the character BP? Is there a way to get and set the rotation speed of an object? When i grab the object, i want to set the rotation speed to 0.

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

alt text

Sorry yeah your right mouse button input was also not working correctly the way you had it,remove the branch it should work fine like this.If it still doesn't work I will send you the project,its working on my now don't think I made any other changes

more ▼

answered Feb 27 '17 at 05:48 AM

avatar image

MadMarsza
22 3 3 6

avatar image MadMarsza Feb 27 '17 at 07:34 AM

Should also be static until u hit RMB so it wont rotate when you pick it up as long as you use set rotation nodes instead of add rotation nodes

avatar image ggez27 Feb 27 '17 at 11:38 AM

Hey, what do you mean that it should be static? Should the object be set to "static" instead of movable? But then i can't set it to "simulating physics", it gets turned off. Just send me your character BP, and i'll look if it works on me. Btw. one question. A few comments back in this post, you said that the mouse rotation should be "Get mouse position scaled by DPI". What does that do?

avatar image MadMarsza Feb 27 '17 at 12:20 PM

No what I mean is the rotation is static while you are holding RMB.Please send me an email to cornelius.marius@gmail.com and I will send you my project files and explain everything for you

(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