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"

Ghost follow player's trajetory inaccurate

I've added additional functionality to example 2d character, so it each TICK adds 2 variables about it's movement in the array, movement axis in float, which I get from InputAxis MoveRight, and is space bar pressed or not. Then, when i press Q, already created character, named Ghost, which is copy-pasted player character with some blueprint changes in it, repeats actions, based on the array created by player character. But ghost repeats it very innacurate, sometimes it stuck or finishes in wrong place. Is it because I use event tick to add and read movement info from the array? If yes, which node can replace event tick?

Product Version: UE 4.18
more ▼

asked Jan 06 '18 at 01:30 PM in Blueprint Scripting

avatar image

17 3 4 7

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

1 answer: sort voted first

Hey there, it kind of depends on the approach you want. If you want the ghost to completely mimic the movement you did earlier without taking into account the dynamic environment, then you can store locations and rotations each frame and play those back. If you want the dynamic environment to affect the playback then you store the movement inputs like you are doing and play those back. Having said that, if you still want to store the movement inputs and not the transforms, then you ideally need to lock fixed fps to have a more deterministic behavior on the playback, see if that helps.

more ▼

answered Jan 06 '18 at 03:04 PM

avatar image

6k 161 129 304

avatar image 451F Jan 08 '18 at 09:37 AM

Well, if i store the transforms, how can I use them to move ghost?

avatar image xlar8or Jan 08 '18 at 09:40 AM

During playback you have a frame index that you are going to increment each tick and access the transform array, all you need to do for that frame is set the actor location and rotation to the values of the transform in that specific frame.

(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