playMaker

Author Topic: How to Make Player Point to Mouse similar to AngryBots?  (Read 3963 times)

blazingriver

  • Playmaker Newbie
  • *
  • Posts: 26
How to Make Player Point to Mouse similar to AngryBots?
« on: May 09, 2014, 03:49:06 PM »
Hi,
First I would like to say that I'm new to both coding and playmaker so please exuse any silly, obvious mistakes I make and if possible, could you use simple terms (I'm not familiar with lots of the terminology).

I am making a game with a similar controls to angrybots, a top down game. I have created a PlayMaker FSM to move my character up/down and left/right.

QUESTION:
However, the current problem I have is making the character point to the mouse (as in angrybots/super stardust) and shoot projectiles (bullets) in the direction its facing.

BONUS:
Also, in the future I would also like to try it out on an iOS/mobile platform, if anyone could offer any suggestions on how I could create a left joystick to move the player movement (up/down - left/right) and at varying speeds and a right joystick to rotate the players Z axis/direction (as in the question) and make it shoot automatically when the player direction is changed (as in super stardust) - i chose this video since it showed the controls that I want
Any help is really appreciated!
Thanks in Advance :)
« Last Edit: May 11, 2014, 07:09:18 AM by blazingriver »

blazingriver

  • Playmaker Newbie
  • *
  • Posts: 26
Re: How to Make Player Point to Mouse similar to AngryBots?
« Reply #1 on: May 11, 2014, 06:58:19 AM »
Here is a post similar to what I want to achieve: http://hutonggames.com/playmakerforum/index.php?topic=2846.0

I have tried using the smooth look at action. However, I am a bit unsure how to use it. How do I make it make the z-axis points to the mouse position?

This is how i have configured it. What have I done wrong and is the smooth look at the right action to use?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How to Make Player Point to Mouse similar to AngryBots?
« Reply #2 on: May 11, 2014, 12:14:01 PM »
Have you checked this out yet?

Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

blazingriver

  • Playmaker Newbie
  • *
  • Posts: 26
Re: How to Make Player Point to Mouse similar to AngryBots?
« Reply #3 on: May 17, 2014, 01:27:50 PM »
Have you checked this out yet?


Thanks for your reply!
I did try that. However, it didn't really work very well. I don't really know how to describe what went wrong, but one thing for sure, it definitely did not have the desired outcome :P
I will see if I can get an image/video of what happened.

One reason I think it might have not worked is because the video described how to make a top down shooter on a flat surface (on the ground). However, I want my top down shooter to orbit a sphere, similar to the game 'Super Stardust'. Do you have any ideas to make it point to the mouse in a similar style to this?


Thanks :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How to Make Player Point to Mouse similar to AngryBots?
« Reply #4 on: June 12, 2014, 03:51:53 PM »
Doing that on a sphere is actually much more complicated.

This thread is basically on that same path, and I think there are some other threads talking about how to approach doing it but I can't recall seeing any actual packaged examples.

http://hutonggames.com/playmakerforum/index.php?topic=5669

The idea is to modify gravity and character orientation based on the surface hes walking on.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

blazingriver

  • Playmaker Newbie
  • *
  • Posts: 26
Re: How to Make Player Point to Mouse similar to AngryBots?
« Reply #5 on: July 15, 2014, 01:09:03 PM »
Hi,
Thanks for your reply (and sorry for my late reply)! I looked at the thread you posted. However, it seems to be investigating how to make the character move across a non-linear surface while also having its orientation perpendicular to the surface. I have already accomplished this by using a rotating spinner to make the character rotate instead, meaning the character has a constant orientation pointing to the centre of the sphere. It, however, didn't really investigate how to make the character's heading/z axis rotate to point to the mouse. I may be misinterpreting it somewhere (as mentioned earlier, I am quite new to unity and playmaker so sorry in advance!) Also, how would you do such a thing on a mobile platform through a joystick?

If required, I will post a demo of my project (so you get an idea of what I am trying to accomplish) and the FSMs I am using to make the player movement perpendicular to the sphere.

Thanks! :)
« Last Edit: July 22, 2014, 09:20:47 AM by blazingriver »

blazingriver

  • Playmaker Newbie
  • *
  • Posts: 26
Re: How to Make Player Point to Mouse similar to AngryBots?
« Reply #6 on: July 28, 2014, 05:22:15 AM »
Any help?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to Make Player Point to Mouse similar to AngryBots?
« Reply #7 on: July 30, 2014, 06:07:58 AM »
Hi,

 typically, I would suggest you use the premade scripts found in the Unity Penelope tutorial, they cover all of this, and provide ready to use prefabs to do exactly what you want.

http://u3d.as/content/unity-technologies/penelope-complete-project/1qZ

 Doing this in PlayMaker will require some experience, and it's totally doable. I am not aware of any sample on this exactly tho.

 Bye,

 Jean