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"

Set Timer by Function not working and no error nor warnings? Glitch?

Hi, I'm working on a game where the main character can transform upon picking up powerups. The powerup only lasts for few seconds and the character transforms back to its original form.

Here's the problem: The timer doesn't always work. There are times when I'd get a powerup and never go back to the original form. What's worse is that the editor doesn't count it as an error so there are no errors/warnings that popup after I test the game.

The characters look like these for now. The one on the far left is the main character, the other two are the transformations. alt text

Here's my blueprint set up:

Power Blueprint- When the Character touches power, the main character transforms alt text alt text

Hero (Character) Blueprint - contains the MorphToHero Function alt text alt text

This was quite hard to figure out what went wrong as I don't get any errors/warnings. I linked the .zip of the rest of the project if you want to take a look.

click this to open the link

Thanks in advance!

Product Version: UE 4.14
Tags:
character_bp.jpg (138.8 kB)
morphtohero_1.jpg (102.4 kB)
morphtohero_2.jpg (51.7 kB)
more ▼

asked Feb 16 '17 at 10:06 AM in Blueprint Scripting

avatar image

juztinmikael
28 4 8 10

avatar image TJ V ♦♦ STAFF Feb 16 '17 at 08:51 PM

Hi juztinmikael,

That zip only contains the assets and not the .uproject file. A lot of references are missing and the blueprints don't compile. Could you post a version that I can open directly and test? You can PM me a link to download it directly over the Forums if you prefer. Please include repro steps from project start.

I did attempt to reproduce your issue but I couldn't get the same results. How many times does the timer work vs not work? 1 out of 10? 1 out of 100?

avatar image juztinmikael Feb 17 '17 at 08:38 AM

Hi TJ Ballard,

I've attached the .zip with .uproject file here. I hope this works updated zip

KeyBindings

alt text

WorldSettings

alt text

there's also a test map in there if it helps

My problem, for now, is that the transforming mechanic doesn't work properly. I've tried to reproduce the problem in PIE and its work-vs-not-work is around 1 out of 5 (20%). I also noticed that the problem gets worse when the Boss_BP is not set to destroyed actor, it goes up to 90%. I'm not sure why this happens.

How should I go about this?

Thank you,

keybindings.jpg (33.3 kB)
woldsettings.jpg (60.5 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

I FIXED IT ! ! Here's how I figured it out.

This game is basically like Temple Run: You run away from the monster chasing you. So what's happening in my blueprint is that everytime the player transforms, the old character gets hidden then a new one spawns, after few seconds the player reverts back to its original form.

Well the problem was the Boss_BP (enemy in this game) destroys even the hidden actor causing the set timer to not call its blueprint. So what I did was that after I hid the main character, I moved it to the side so the enemy wouldn't kill it.

Here's the problem

alt text 1.Player Transforms, OldCharacter gets left behind at the spot where the powerup was

alt text 2.Enemy Catches it and kill it

Here's the Fix alt text MainCharacter now hides to the side to avoid the enemy's kill sphere

alt text

The blueprint is pretty much the same as I inserted in the previous answer, I just added AddWorldOffset before the set timer.

The simplest logic is basically:

Power Overlap > Cast to MainCharacter > Set Actor Hidden > UnPossess > Spawn NewActor > Possess > AddWorldOffset > Set Timer by Event > Add Score > Destroy PowerUp Actor

THANK YOU :D

herotransform.jpg (51.6 kB)
herogetskilled.jpg (59.1 kB)
pushedthehero.jpg (96.1 kB)
fixedbp.jpg (119.3 kB)
fixedbp2.jpg (115.3 kB)
more ▼

answered Feb 26 '17 at 10:02 AM

avatar image

juztinmikael
28 4 8 10

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

Hi juztinmikael,

Sorry for the delay.

So it looks like it's a logic issue in your Boss_BP. Currently; OnComponentHit you have it cast to the Blocker_BP > On Fail > Cast to Enemy_BP > On Fail > Cast to Character. This seems to be causing the issue. You need to either add in some sort of logic that it only cast to the correct actor when it is hit or change the Cast To Character to Cast To Hero_BP. That seems to work as well.

Let me know if that fixes the issue on your end or not.

more ▼

answered Feb 23 '17 at 03:48 PM

avatar image

TJ V ♦♦ STAFF
41.1k 1009 183 493

avatar image juztinmikael Feb 24 '17 at 08:47 AM

Hi TJ,

It didn't fix the issue on my side. I don't quite fully understand how does the Boss_BP affect the SetTimer from my Hero_BP? When the boss is present in game, the character transformation doesn't work at all. How should I go about this? Thanks

avatar image juztinmikael Feb 26 '17 at 10:12 AM

Hi TJ,

I wasn't able to figure it out your way, but I figured out what's causing the problem. I came up with a solution that was easier for me to execute and understand.

The problem was the enemy killed the main character even though it was hidden. From there I tried to make a simple fix to it.

Thank you for taking your time on helping me, I appreciate it!

(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