Download

Removing object dynamicaly when trigger hit.

Hi all,

Making my first game / learning as I go. I want to get functionality like the original Mario Bros from the NES with the coins. When I (using FPS template) go over a certain object, I want it to disappear and increase my score.

Can someone point me in the right direction for doing this?

Right now I am going to manually stage the mesh “coins” if you will. Will I need a box trigger (or something like it) for each object, or can I do this through collision of the object itself?

How do I detect this collision and once it happens, remove the model from the map?

Thanks in advance,

It’s pretty simple really. Create a new class blueprint derived from actor, add a static mesh (or whatever you want), and then call either OnComponentHit or Event Actor Begin Overlap. Use the first one for actors that can block you:

And this one for actors that you can pass through (e.g. no blocking collision):

You might also consider watching a few of the blueprints tutorial videos, they explain quite a bunch of stuff. Definitely worth it.

Thank you Fuchs, can you elaborate a little on “Create a new class blueprint derived from actor”? I see what you have done above in the screen shots and it makes sense - what do mean when you say “new class blueprint derived from actor”. I have a level blueprint, a HUD blueprint, and a blueprint interface to share info back and forth.

I watched a number of different videos and to be honest they started to shoot over my head. I needed to get my hands on the content and tinker in a project to really make connections; hence I am here hat in hand.

Thanks for the help.

In your editor at the bottom left corner you have the content browser. Once you create a blueprint there, a windows pops up asking you to chose a base class (Actor, Pawn, Character, Game, Player Controller, Hud, …). For your use case a blueprint with actor as its base class (or in other words the class it is derived from) should suffice.

As I continue to work, will I have Blueprints for almost everything dynamic in the game? I thought I was going to only have a couple - if I were going to have a game type roughly like mario where I have to collect coins, would the coins have their own blueprint? Is there a best practice limit to the number of blueprints to have in a project? Infinite?

I think I have some hands on experience now that I can start going through the documentation and have it make sense. Are the textural write-ups on the site good? Or should I be looking for a playlist of youtube videos. I already watched the majority of the Epic sponsored ue4 ones on youtube, except the C++ specific ones.

Where did you (and everyone) learn?

Thanks

Everything that has some kind of interaction or that needs some kind of logic will be a blueprint. A light with a switch, a simple moving platform etc. pp. will all be blueprints. And that’s a good thing.
I don’t know whether you are coming from a programming background or not, but the blueprints are also called class blueprints (level blueprint being the exception). A class is a kind of template of which you can instantiate objects. Imagine your coin blueprint in your content browser. You can create infinite instances (i.e. actual coins in your world) of it by just pulling it into your world. And that’s great. Just imagine if you had to copy and paste the coin logic again and again for each coin you want to create. And there’s more. Class blueprints are independent from levels and projects, meaning you can easily re-use them in other places. And that’s just the tip of the iceberg of the capabilities of blueprints.

Learning UE4 is a combination of things. Watching the official tutorial videos, reading the doc, reading / watching community tutorials, learning by doing, helping others with their problems. Or at least taking a look at the forum and what people post. Screenshots of blueprints, ideas etc. You can really learn a lot from these sources.