EscapeRoom - Game Dev Log #3: What I got so far (part 2)

in #gamedev6 years ago

What have I done so far?

Let's talk about what else I have managed to do: Grabbing! I think that even if I will make an inventory system, I will still need a form of grabbing so the player will be able to move things around. So first thing first I decide that I can move any object that have physics, I made a grabber system and attached it to an action I called "Grab" - I binded it to the 'F' key in the keyboard, but can bind it to more keys and change at a heartbeat.

Now I have made a simple if statement to check if I pressed my "Grab" button, if so I am doing a couple of things:
I put in a veriable I called 'HitResult' the object in the players current sight that is in reach:
auto HitResult = GetFirstPhysicsBodyInReach();
(note that GetFirstPhysicsBodyInReach() is a function I have wrote on my own)
Next I get the object I want to grab, inside the 'HitResult' there is a GetComponent() method.
Than I am using a function called GrabComponentAtLocation() that is implemented inside the PhysicsHandle given by the UnrealEngine, the function gets the component to grab and a few more veriables and handles the grabbing for me.


Yes yes, I know it was very technical right now and I did get a bit into code even though I said I wont... Can't say it wont happen again but I will try my very best to stick to general things I did and short updates from now on!
Plus, I have only free time to work on my personal projects at weekends so expect updates from now on - only on a weekly basis!


Sort:  

Congratulations @taltalim102! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @taltalim102! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!