Download

Clicking once on blueprint, clicking a second time on component of the blueprint

Hello!

I have a bookshelf blueprint filled with books (that are also blueprints). The first time I click on my bookself, my camera changes location so it focuses on my bookshelf (so I can see the books clearly because this is a top down view game). How can I make it so that I am then able to click on each and everyone of the books of my shelf (and not interact with the shelf itself once I am focused)?

Presumably you’re getting the world location of the bookshelf to move the camera? Then you can also get the world location of the component.

Thank you for your help!
My camera works fine.
My problem is that I don’t know how to handle the On Clicked events.
Right now, when I click on the bookshelf, my camera does move. What I would like is that if my bookshelf is not focused, then the ‘On Clicked’ on my books would trigger the camera movement. But then, if the book shelf is focused, it’s the events of the books that should get triggered.
And my problem with this is that there are several bookshelves and several books in my level, so how do I go about : “If you click on this book, then focus the bookshelf it belongs to. And then, if you click again on this book, then read it.” Or how do I go about disabling all the events of my books so the On clicked triggers the bookshelf beneath it, and then enable all input of my books once the bookshelf is focused.

This what I run when I click on the bookshelf (or trigger the camera movement)


This is what I have on my books

This does not function properly but I don’t know why.

Hopefully, this makes sense.

You can get rid of the enable input thing, by setting it in the BP:

](filedata/fetch?id=1860755&d=1612885205)
( less nodes to worry about ).

I’m thinking about the rest…

EDIT: I think if each book has a reference to the shelf, it can check a bool in the shelf to see if it’s focused. If not then do that. If it is, then open the book.

Does that make sense? Something like this:

](filedata/fetch?id=1860767&d=1612885766)
and the shelf has:

Or a bit more formally, if you made the variable ( in the book ) for the shelf of type actor:

Thank you! This is exactly what I needed! Perfect