Download

Setting up a blueprint for object interaction (I'm a noob any help is appreciated)

**Sorry fro my noobyness as i am new to blueprint and game development in genral.

I’m not sure how particular my problem is as I don’t know much and I could be asking a very broad question.

I want to make a blueprint that basically set off a timer when the cursor cross hairs are over an object and if player is close enough to object that timer will start and when it runs out the player automatically interacts with the object.
Basically what im trying to do is eliminate those pesky button promts and heaving to press a button to interact with an intractable object. For example: Instead of a player walking up to the watermelon object and press a button to pick it up, if the player is close enough to the watermelon and is pointing the crosshairs at it it will atomically pick it up after lets say a 2 second timer.
Is this possible to achieve with blueprints?
Again I’m sorry but I’m very new and this question may be stupid without me realizing but I would be very grateful for any kind of help or explanation as to how this works and could be made or just general expending of my knowledge of how blueprints work.**

Im a noob too but ill give this a shot.

yes you can do that with blueprints. I have bin watching the tutorial videos that are linked from this sight and have learned a lot from them. “Blueprints - 1 - Blueprint Intro” is a good place to start. It will show you the basics.

yeah same iv been reading,watching researching and studying all about UDK for the past few weeks but with this one i could just not make heads or tails of it.

Check out the Solaris example videos for a demonstration of using a trace to figure out which object is under the player’s crosshairs.

If there is an object you care about is under the crosshairs (which can be tested for with a cast), then record the current time and the viewed object in variables. Testing stuff with casts is also demoed into the Solaris example videos. Watch them!

If the object being pointed at currently is the stored object, and (the recorded time - the current time) > X seconds, then perform whatever behavior you want to perform. You could send an event to the object, and let the object itself handle doing whatever, for example.

An alternate way of doing this is to start a timer object within your interface blueprint whenever you are hovering over an interesting object, and stopping the timer when you are no longer hovering over an interesting object. If the timer reaches it’s conclusion, do stuff. If you use a Timeline instead of a Timer, you can use the Timeline value to drive a little progress bar (perhaps displayed near your crosshair), to give the player a visual indication of when the interaction will occur.

This might also be helpful: http://youtu.be/WwfsWr4A894

Thanks a lot :slight_smile: that was very helpful. im so glad i went with UDK in the end the community is just fantastic.

Thanks very much iv been slowly going trough all the tutorials you guys from UDK provide. I must say probably some of the best stuff iv seen EVER! better then most of the digital tutors tutorials and those are not a penny or two. All given to us for free on youtube. You guys are doing an amazing job and i just want to take the opportunity to thank ever single employee of epic and especially the UDK devs who make this possible. Love you guys <3 Thank you for all your hard work. :slight_smile: