So in my infinite wisdom (I have no idea how I did this, but I did a couple of semi coherent wild guesses) I managed to create a system where if I use my right stick my player character will look where the stick is pointing.
How it works is, is that if I aim (move my right stick into any direction), my character will face into the direction of a reticule object that is circling the player. I don't actually need to see the reticule, so I made it not draw itself. However, for future reference, I would like to know a way to make the reticule always stay a minimum distance away from the player.
Here is my code that is placed in the reticule object:
///Circle Around Player if Aiming
if !keyboard {
reticule_dist = 16;
x = obj_p1.x + lengthdir_x(reticule_dist*gamepad_axis_value(0,gp_axisrh),east);
y = obj_p1.y + lengthdir_y(reticule_dist*gamepad_axis_value(0,gp_axisrv),south); }
///End of Code
What the reticule obviously does here, is return to the center of the player if the aim stick is not used. It's not that big of a deal, since the player will face a direction if you're not aiming. The slight problem I have is that the if the player is standing still, and you stop using the aim stick, the player sometimes jolts a little to the direction of the returning reticule (EDIT: THIS JOLT IS NO LONGER AN ISSUE, SINCE I FORGOT TO REMOVE SOME KEYBOARD ACTIONS). I got this far by pretty much just subconsciously understanding how this thing works, so placing a minimum distance to the reticule from the player seems to be out of my reach, though I love exploring and I will try different things out.
While I do that, it would be great if any of you could give a simple solution to this issue. Thanks!
How it works is, is that if I aim (move my right stick into any direction), my character will face into the direction of a reticule object that is circling the player. I don't actually need to see the reticule, so I made it not draw itself. However, for future reference, I would like to know a way to make the reticule always stay a minimum distance away from the player.
Here is my code that is placed in the reticule object:
///Circle Around Player if Aiming
if !keyboard {
reticule_dist = 16;
x = obj_p1.x + lengthdir_x(reticule_dist*gamepad_axis_value(0,gp_axisrh),east);
y = obj_p1.y + lengthdir_y(reticule_dist*gamepad_axis_value(0,gp_axisrv),south); }
///End of Code
What the reticule obviously does here, is return to the center of the player if the aim stick is not used. It's not that big of a deal, since the player will face a direction if you're not aiming. The slight problem I have is that the if the player is standing still, and you stop using the aim stick, the player sometimes jolts a little to the direction of the returning reticule (EDIT: THIS JOLT IS NO LONGER AN ISSUE, SINCE I FORGOT TO REMOVE SOME KEYBOARD ACTIONS). I got this far by pretty much just subconsciously understanding how this thing works, so placing a minimum distance to the reticule from the player seems to be out of my reach, though I love exploring and I will try different things out.
While I do that, it would be great if any of you could give a simple solution to this issue. Thanks!