Closed DoctorMikeReddy closed 3 years ago
NOTE: screen shots are from another game, but are similar to those I have uploaded to the repo, in branch "mouse".
Firstly, we need to create an InputAction in Edit-> Project Settings -> Engine-> Input: This creates an Event Action Blueprint that can be used in the 2D side scroller controller. We are going to use this initially to just print text to the screen during play; it will not distinguish between left or right buttons yet: but running the game and clicking the mouse buttons now works: Making the mouse pointer show while playing - normally, it disappears after you click in the run window - by altering the player controller BP: Normally, this would be done in a menu blueprint, but as it is part of the game, I have added it to the player controller for convenience. [No point showing a screen shot, as Windows removes the mouse anyway; trust me, this works now]
Pushed to branch "mouse". Next is finding a way to distinguish between left and right mouse buttons. And removing the player character. Some useful resources:
https://www.youtube.com/watch?v=KakLXqpwnjo - a tutorial for adding clickable objects in a 3D game, so not so relevant to what we want, but showing the mouse events was useful, even if it was out of date
https://www.worldofleveldesign.com/categories/ue4/ue4-getting-started-crash-course.php
A better static camera, with material adapted from here: https://romeroblueprints.blogspot.com/2015/06/paper-2d-game-sprites-and-camera.html
Replaced the player character with a mouse mode player controller. Based these changes on the following tutorial: https://docs.unrealengine.com/4.27/en-US/Resources/ContentExamples/MouseInterface/MouseControlSetup/ Removed all the previous player controller blueprints. Again in the mouse branch. Enjoy.
Say here if you need any further help. When you are happy, we can merge this into the main. You will have to add the AI spawner, etc, from the other branch, lemming, at your own pace. Mouse currently does nothing, so you will need to add code to the MouseController class
These videos might be of use: https://www.youtube.com/watch?v=PdX5HJz8Z5U https://www.youtube.com/watch?v=qdlF5KI83WY This tutorial might also be useful: https://medium.com/@willsaunders_73724/context-sensitive-mouse-cursor-tutorial-for-unreal-engine-4-69ccd6261cc
After discussions yesterday, Monday 18th, it is clear that the game needs mouse input, a la the original Lemmings, and the player character removed. I will make a branch off main to do this.