How to make a Myst like game in unreal.

Presumably you have two interfaces calls? Interactible, and Interact?

You call Interactible on tick to change the cursor, and the other when the player presses the mouse button or hits E.

So you have this in the player?

and that just does a line trace ( 1 ) and makes the interface ‘interact’ call on the object.

This is what I have in my player on tick

and

Does it make sense? :slight_smile:

1 Like

Oh I think I see what you’re saying. I have only one interface, which is Interact. I was trying to piggy back the Input Action to the rest of the code but having two interfaces makes more sense, one for the line trace and dot and another for the action on it. I’ll try this. Thanks!

1 Like

You can just have one, but then don’t call it until you actually get the mouse click ( or E etc ).

I’m using a BPI call ‘Highlight’ to do the cursor change thing you’re doing. Except I’m not doing it with a cursor, I’m using a post process to outline the interact-able part.

1 Like

Ok now I think I understand. So on your tick you have the highlight post process running for those line-traced objects that implement your BPI interface then on your custom Mouse Click Event, you perform the Interact function for those that also meet the same criteria. This makes sense.

1 Like

Ok so I’ve got it working for the moment.

I have this for pressing the Interact Button:

It’s working fine (at least for now) but I’m trying to figure out how to disable Interaction after the code has run, in other words say I open a door and I want it to be “inactive” after this. I tried disabling the input but of course that disables the controller.

When I interact with the door, it turns and stops and doesn’t move anymore, I think because I set the finished node on the timeline, however when I keep pressing “E”, I can see the data keep flowing under the simulation.

My other idea is to disable the Interface or set it to none after it’s over. I was trying to find an interface variable on the blueprint but I couldn’t find it. Is this something I have to add to the Interface itself, like a function that renders the item static or something? Or maybe I can just set the item as static after it’s over? Thanks.

1 Like

The delay won’t do anything, actually.

The way to stop people ‘spamming’ the interact, is in the door BP

If you only want to make it interact once, just don’t reset the DoOnce :slight_smile:

1 Like

Awesome, had no idea that node existed. Thanks!

1 Like