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"

Character can't move when placed in a new location

       I'm trying to create a side-scroller game where if the player falls in the lava, they lose lives and reset's the player to the spawn point. However, at the start of the game, the movement is fine, but, when the player falls into the lava, the player get's set to the new location but the movement doesn't work anymore. The animations are still playing but the player doesn't move anymore. I've tried setting the movement mode to walking but that doesn't work.

Note: the new location is in midair.

Thanks for your help.

alt text

Product Version: UE 4.20
Tags:
more ▼

asked Aug 31 '18 at 12:51 AM in Using UE4

avatar image

Austin1322
17 2 2 5

avatar image ThompsonN13 Aug 31 '18 at 01:04 AM

are you moving just the mesh or the actual character? how do you handle movement? are you destroying the character at all or just moving it (looks like just moving)? are you changing anything in the player controller? how often are you setting the location? do you reset the lava hit bool after moving the character?

i would guess based on the limited information provided that you are checking lava hit on tick and not resetting the lava hit variable. but thats just a random guess since theres not much else to go on.

avatar image Austin1322 Aug 31 '18 at 01:06 AM

OMG I just realized how unobservant I am. I forgot to reset the lava hit to untrue.

avatar image ThompsonN13 Aug 31 '18 at 01:19 AM

haha its always those small things. does it work now?

avatar image Austin1322 Aug 31 '18 at 02:22 AM

It works now but another problem comes up. The character is floating in midair and it doesn't matter where I move it's still floating in mid-air and when I jump, it resets the character to the spawn place

avatar image ThompsonN13 Aug 31 '18 at 02:37 AM

it sounds like your still setting the location but again without seeing the script its hard to say.

avatar image Austin1322 Aug 31 '18 at 02:39 AM

I am setting the location of the character

avatar image Austin1322 Aug 31 '18 at 02:42 AM

I could show you a picture of the begin overlap event: alt text

Another problem I found was that the D and A keys for moving right and left rotate the entire map. Note: All of these error happens after I step on the lava

capture.jpg (54.8 kB)
avatar image ThompsonN13 Aug 31 '18 at 03:04 AM

the code im interested in is what comes before the set location. basically the rest of the first picture you posted. your input is moving your map? you mean like the level itself? thats really odd

avatar image Austin1322 Aug 31 '18 at 03:07 AM

alt text

The inputs are either moving or moving the character in a big circle

capture.jpg (132.0 kB)
avatar image ThompsonN13 Aug 31 '18 at 01:39 PM

ok for the lava part i would eliminate the part that comes from tick as its not really needed and its just wasted performance. instead i would set the location just after the cast where you overlap event is. basically instead of checking is lava hit true 30-120 times per second, you just say when the player overlaps the lava im going to move him. its much simpler and better performing. dont know if that will solve the issue completely but its a step in the right direction.

as for your other issue you will need to explain whats happening in better and more clear detail. show the inputs so we know how they work and maybe make a video or something so we can see the issue your talking about.

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

0 answers: sort voted first
Be the first one to answer this question
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