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"

Paint a continuous line at every point that a character touches - sprite platformer

Hi, I'm working on a side-scrolling sprite platformer, and I want it that wherever the character runs, it leaves behind a coloured trail. So basically, a coloured spot at every single point that they touch, which would give a continuous coloured line painted everywhere that they've been.

I'm very new to development so please talk to me as if I'm stupid and assume that I know nothing.

Anyway, I've been using hitboxes around the character capsule (ideally I wanted different colours for bit that they walked over and bits that they touch with their sides) which spawn an object on collision with objects in the world, but since that only generates an object at the initial overlap, it doesn't leave a trail at all. What am I missing? I must be going about this the wrong way. Do I want to be using sweeps, and if so how? Examples of blueprints would be fantastic.

As you can see, my current blueprint for this is basic in the extreme. This shows how I'm handling the overlap for the hitbox on the left of the character, but there's one on the right and one at the bottom too, and they're all working the same way.

Thanks!

alt text

Product Version: UE 4.13
Tags:
overlap.jpg (210.5 kB)
more ▼

asked Dec 31 '16 at 01:54 PM in Blueprint Scripting

avatar image

monkeymilkman
1 1 2 3

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

1 answer: sort voted first

While I may not understand what you want to do entirely, I'll try to help LOL. So off the top of my head you can try using a spawning event which spawns your object and then have a timer with some kind of duration to maybe sync up with the footsteps of your character. The timer would loop depending on whether your character is moving or not. Here's and example. Just take note it may not be perfect but hopefully it'll help.

alt text

alt text

EDIT: Using this you probably won't need those hitboxes on your character but that's mostly up to you if you want to keep them.

spawning.png (282.9 kB)
tick.png (235.4 kB)
more ▼

answered Dec 31 '16 at 03:52 PM

avatar image

RadiantWings
66 13 15 18

avatar image monkeymilkman Jan 01 '17 at 02:17 PM

Hi, thanks a lot for replying! That seems a lot more complex than what I'm actually trying to do (unless I've misunderstood which is entirely possible).

So this is the blueprint I'm working with at the moment. When the character moves over a surface in the tile map, I thought this would continually spawn cubes where the overlap occurs, creating a line.... but it doesn't work. I just want a colored line under them where they've moved. Sorry, real noob

alt text

spawn_blue.jpg (282.4 kB)
avatar image RadiantWings Jan 01 '17 at 05:18 PM

Okay maybe I should've asked how the movement in the game should've worked. For some reason I was thinking about 2D platformers at the time.

So when you say time map, are thinking about something like a grid, and when the player presses W, A, S, or D the player moves to the next appropriate grid and leaves a line on the previous tile? So something like this?

alt text

EDIT: To make sure I'm clear, the purple line is that line trace you wanted to spawn.

new canvas.jpg (77.8 kB)
(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