001 Game Creator

001 Game Creator

View Stats:
Kimchi Jul 3, 2018 @ 6:05pm
Mouse aimin'
Hey folks, i've searched the forums and here but have had no luck.

I'm making a top down shooter using the standard rpg preset but i was wondering if there were a way to make the player look a the mouse - possibly using 8 axis instead of 4 as well?
< >
Showing 1-11 of 11 comments
Slash0mega Jul 3, 2018 @ 6:15pm 
if you mean mouse where it locks into the 8 cardenal directions, that is possible, but a bit more involved than having free rotation where it just follows the mouse.
Kimchi Jul 3, 2018 @ 6:57pm 
Originally posted by Slash0mega:
if you mean mouse where it locks into the 8 cardenal directions, that is possible, but a bit more involved than having free rotation where it just follows the mouse.
Free rotation would certainly be more ideal!
MrNumbers  [developer] Jul 4, 2018 @ 11:14am 
What you need to do is setup a "While/Timer", you can do this in the main player's actor settings (Create a new trigger, top right of the window)

Inside the while/timer you will want to use the "Change Rotation Z" event, the direction must be set using the "Geometry > Direction" use-value.
The "Source X/Y" should be the X/Y location of the player (Actor("this").X and Actor("this").Y) and the "Destination" needs to be the "Cursor > Targetted X of Z" and "Cursor > Targetted Y of Z" use-values. You can leave the "Z" option as "0" in the cursor use-values.

This should make the player continuously face the direction of your cursor!
Kimchi Jul 4, 2018 @ 2:00pm 
Originally posted by MrNumbers:
What you need to do is setup a "While/Timer", you can do this in the main player's actor settings (Create a new trigger, top right of the window)

Inside the while/timer you will want to use the "Change Rotation Z" event, the direction must be set using the "Geometry > Direction" use-value.
The "Source X/Y" should be the X/Y location of the player (Actor("this").X and Actor("this").Y) and the "Destination" needs to be the "Cursor > Targetted X of Z" and "Cursor > Targetted Y of Z" use-values. You can leave the "Z" option as "0" in the cursor use-values.

This should make the player continuously face the direction of your cursor!
Cheers! Unfortunately i'm lost after getting as far as the Change Rotation Z event. Couldjya break that down or well, in my case make it dumber haha - I've tried searching event and local variables for "geometry > Direction" but to no luck
Slash0mega Jul 4, 2018 @ 2:36pm 
when in events, there is somthing known as a "use value" button, and it is to the left of almost every field in a event setup.

it the button in the purple square https://www.engine001.com/community/uploads/using.PNG

it lets you acesss TONS of engine data, from actors stats and variables, to mouse position, how long the game is running, ect.

if you need more help, just say so, i am making sure i am subscribed to this discussion
Kimchi Jul 4, 2018 @ 2:59pm 
Hey guys, again thanks for helping. So i've gotten it all working but then get an error debug on my actor, seems to be involving the change rotation event once i add the Use Value... Hrmm.. Any ideas? Also open to sending this to whomever so they can test
Slash0mega Jul 4, 2018 @ 3:43pm 
in the scripting interface, there is a share script button in the title bar, can you click that and share the link it gives you?
Kimchi Jul 4, 2018 @ 3:50pm 
in the Script Debugger i see no option to share.. the error is "actor "-1.570796" is not valid" if that means anything?
Slash0mega Jul 4, 2018 @ 8:17pm 
its not in the debugger its in the script interface itself. though it sounds like you are using a rotation in the actor feild instead of a actor,

https://www.engine001.com/cache/thumbnails/550x0-community_uploads_Comparison%20Branch.jpg.png

at the top of the screen you will see "Script Mode Tools Help" under one of those headers, i think script or tools, you will find a share script option.
Kimchi Jul 4, 2018 @ 9:17pm 
I got it working! Realised i skimmed a little too much... player only rotates to the 4 axis but maybe that's cause i haven't put in a top down model yet...
or because the character only faces 4 ways regardless?

update: full rotation using "Effects" as the body.. weapons not showing.. will update further

update: for an item, under the "equipped" trigger, attaching a sprite will have the item appear, but not rotate. Tried using an effect like with the player but no luck. tried copying the rotate script but that causes a string of conflicts.

update: I literally didn't click "rotate with chracter" for the items "equipped - attach sprite" lol.
It's clearly time for bed. Will continue working tomorrow and update further!
Last edited by Kimchi; Jul 4, 2018 @ 9:39pm
Kimchi Jul 5, 2018 @ 5:03pm 
Progress is going really well following all you's'is help, i'm aiming to make a tutorial drawn out with pics for this but i've hit another snag. Bullets. Sometimes they seem to hit this invisible collision and not fly across the screen but die near the player.

I've checked all collisions and sprite placements but nothing should be interfering.. Any ideas?

updaTE: i lied, Z collision was high. set it to 0 and all is well
Last edited by Kimchi; Jul 5, 2018 @ 5:42pm
< >
Showing 1-11 of 11 comments
Per page: 1530 50

Date Posted: Jul 3, 2018 @ 6:05pm
Posts: 11