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 Grabbed Object

I know this thing has already been asked but it hasn't gotten a clear answer and it has just been forgotten. I am making a grab system and I want to be able to rotate the object like in this video: https://www.youtube.com/watch?v=zWd-Z20praQ . I am having trouble doing this. Please help me figure out how. Currently I have something like in this tutorial : https://www.youtube.com/watch?v=OltZ-xFz8IQ∈dex=7&list=WL but I switched "Grab Component at Location" for "Grab Component at Location With Rotation" to prevent my object spinning. Please help me get this working, Thanks! :D

Product Version: UE 4.17
Tags:
more ▼

asked Sep 15 '17 at 07:10 PM in Blueprint Scripting

avatar image

Rymazon
46 6 8 11

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

2 answers: sort voted first

I the way I do this in my game:

  • My Player has a SceneComponent called HeldObjectLocation placed where the player should hold the object.

  • On Pickup, I set the rotation of HeldObjectLocation to the same rotation as the object I'm picking up.

Pickup Object

  • On Tick I call this custom event below (could be a function). This updates the physics handle to orient the desired location and rotation for the attached object.

Hold Object

This should be enough for you to be able to pickup objects with their current rotation and maintain that relative rotation as you turn (which is even more than the featured video is able to do). To add more rotation with key inputs, set up those bindings, and simply add the rotation to the HeldObjectLocation SceneComponent, when the keys are pressed and you are holding an object.

more ▼

answered Sep 15 '17 at 08:31 PM

avatar image

BenVlodgi
2.1k 37 17 52

avatar image Rymazon Sep 15 '17 at 10:52 PM

Thanks! It worked great!

avatar image TheFlyingCacti Dec 04 '17 at 05:10 AM

Wow, Thanks so much. It took me ages to search the internet for that solution! ;)

avatar image Lord Pol Feb 13 '19 at 04:24 PM

Thank you. Helped me here too.

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

Can anyone share the blueprint of solution? as I am new to unreal so its difficult for me to understand.

more ▼

answered Apr 03 '19 at 11:22 AM

avatar image

Gohar.Shaikh
1 1

avatar image BenVlodgi Apr 03 '19 at 03:03 PM

This is all very clearly explained above, I suggest reading the documentation and watching tutorials to become further familiarized with Unreal Engine.

(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