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"

Grabbed objects get stuck

In my project the player has the ability to teleport between levels, he can also pick up physics object in the world and teleport with them,

the issue is that when the player teleport with something in his hands it tends to get stuck between levels, and i don't know how to fix this

Ps: the levels are layered on top of each other

alt text

Thanks for any help!

Product Version: UE 4.20
stuck.gif (4.4 MB)
more ▼

asked Aug 30 '18 at 01:42 PM in Blueprint Scripting

avatar image

58 4 7 14

avatar image HarryHighDef Aug 30 '18 at 01:44 PM

What do you mean stuck "between" levels?

avatar image kaosrio Sep 03 '18 at 01:53 PM

Sometimes the object that the player is holding can get stuck underneath the floor

avatar image dZh0 Sep 03 '18 at 02:50 PM

The object get stuck underneath the floor when teleporting or there is no relation?

avatar image kaosrio Sep 03 '18 at 03:10 PM

Yea, only when i teleport, because the player teleports to the floor above, and the object tries to follow. i fixed this by setting the world location of the held object when the player teleports. However objects can still get stuck in between floors sometimes if theres lag.

avatar image dZh0 Aug 30 '18 at 02:34 PM

You should take care to teleport the stuff in his hands and the hands themselves too. (manually)

Now how you do it depends on your particular teleport mechanic. Maybe you can just store it and re-set their positions. Maybe you should destroy and re-spawn them after the teleportation.

avatar image kaosrio Sep 03 '18 at 01:52 PM

Thanks, this is my current solution although if there's lag in the game it can sometimes still get stuck

avatar image hideto May 22 '19 at 08:57 PM

Thanks, this helped me understand how physics handle works.

avatar image Tuerer Aug 30 '18 at 03:31 PM

You can save the object, and on begin play Spawn it again and attach to physics handle again

avatar image mightyenigma Dec 03 '18 at 05:32 AM

When you set the Location of the held object, remember to turn off the Sweep option.

avatar image kaosrio Dec 14 '18 at 10:39 AM

Yup, sweeping is turned off

avatar image Tuerer Dec 14 '18 at 10:59 AM

You can try releasing the object, teleporting it in front of the character, and then immediately grabbing it again. Maybe the physics handle trying to pull the object somehow interferes with the teleportation.

avatar image kaosrio Dec 15 '18 at 10:24 AM

ooh, good idea, i'll try it out

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

2 answers: sort voted first

If you are holding an object. Save a reference to this PrimitiveComponent and its Actor. When you teleport, make sure to set the world location of the held object to the desired held object location.

You can call SetWorldLocation on the primitive component.

  • Swept: False

  • Teleport: True

Or you can call Teleport on the held object's actor if the physics component is the root of the actor.

more ▼

answered May 23 '19 at 06:14 PM

avatar image

2.2k 39 17 52

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

To prevent objects from getting stuck in the floor, I often teleport them to a location higher than the floor, then have move them down to the desired location in Z, with Sweep option on. This is similar to placing an object in the editor, then tapping the "end" key, although it won't place them so far down as that if there's no floor for a long way.

more ▼

answered May 23 '19 at 07:23 PM

avatar image

3.7k 18 23 20

(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