playMaker

Author Topic: RayCast From GameObject  (Read 20906 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14121
  • Official Playmaker Support
    • View Profile
Re: RayCast From GameObject
« Reply #15 on: June 17, 2013, 05:55:10 AM »
Hi,

 I changed the name of the file, can you download it again from that post, it may be a caching problem or something.

bye,

 Jean

Andys

  • Playmaker Newbie
  • *
  • Posts: 30
    • View Profile
Re: RayCast From GameObject
« Reply #16 on: June 17, 2013, 08:26:44 AM »
Hi jean,
Ive tested the new RaycastTest file, and it does the same as before, just sits in the Fire Delay state, and the error is still present in the Get Mouse Button state.

One clicking the mouse what should it be doing? as it does not move from the Fire Delay state.

Andy

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14121
  • Official Playmaker Support
    • View Profile
Re: RayCast From GameObject
« Reply #17 on: June 18, 2013, 11:10:39 PM »
Hi,

 import it in a new project, you are still in the old scene.

bye,

 Jean

Andys

  • Playmaker Newbie
  • *
  • Posts: 30
    • View Profile
Re: RayCast From GameObject
« Reply #18 on: June 19, 2013, 11:10:24 AM »
I have created a new project and it is still the same.

as i said before, on clicking the mouse what is purposed to happen, as i cant see anything

Andy

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14121
  • Official Playmaker Support
    • View Profile
Re: RayCast From GameObject
« Reply #19 on: June 19, 2013, 10:43:27 PM »
Hi,

 ok, let's recap, I think I know where the confusion is.

 mouse click will nto fire where you click, it will only update the raycast when you click.

so.

1: open "Laser/firing system" fsm.
2: make sure that "Use Mouse click for firing" is true
3: run the scene
4: move the gun with WASD keys, you will see that the raycast doesn't update,
5: click, the rayscast fires and adjust the red debug rectangle.

Is this better?

bye,

 Jean


Andys

  • Playmaker Newbie
  • *
  • Posts: 30
    • View Profile
Re: RayCast From GameObject
« Reply #20 on: June 20, 2013, 01:14:45 PM »
Hi Jean,
Tried as you have listed and up to point 4 all ok, but when clicking in scene, nothing updated. Should the bool test in on mouse down have a variable?

Andy

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14121
  • Official Playmaker Support
    • View Profile
Re: RayCast From GameObject
« Reply #21 on: June 20, 2013, 10:28:27 PM »
HI,

 ok, I have an issue with drop box it seems... indeed it's still the old package... so I have copied it ( instead of renaming it) to a different location:

try this:

https://dl.dropboxusercontent.com/u/17356625/Unity/playmaker/samples/raycast.unitypackage

bye,

 Jean

Andys

  • Playmaker Newbie
  • *
  • Posts: 30
    • View Profile
Re: RayCast From GameObject
« Reply #22 on: June 21, 2013, 04:14:07 AM »
Hi Jean,
now working as you explained.

If i am to fire a projectile on mouse click, is the vector 3 variable "look at target" the one to use?

thanks

Andy

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14121
  • Official Playmaker Support
    • View Profile
Re: RayCast From GameObject
« Reply #23 on: June 24, 2013, 12:21:02 AM »
Hi,

 Good, sorry for the mess :)

Nop, the look at target is the actual point where the raycast hits.

if you want fire a projectile, you need to fire from the z axis of the gun ( in our case).


For this, use "transform direction" action, reference the gun, and for the local direction (0,0,1), which is the z axis.
 that's your direction to add force to a projectile.

bye,

Jean

colpolstudios

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: RayCast From GameObject
« Reply #24 on: August 08, 2014, 02:44:38 PM »
Hi, I just wish to confirm that the play maker scene works fine.

Would you mind if I updated this with some minor improvements?

1. Model a new cube and uv map it so we can see the direction we shoot in.

2. Ability to hit and test enemy or wall hit and create particle effect at hit points.

3. Test did we hit nothing and take action

Thank you for the time taken to create the example.

Learned a lot from it:)




jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14121
  • Official Playmaker Support
    • View Profile
Re: RayCast From GameObject
« Reply #25 on: August 11, 2014, 06:20:36 AM »
Hi,

 Good, that's going to be a nice sample to add to the ecosystem. Can you bump this early september? Unite is getting closer, I don't think I'll have time before.

 Bye,

 Jean

colpolstudios

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: RayCast From GameObject
« Reply #26 on: August 15, 2014, 03:02:24 PM »
Hi, Jean here is the web player demo.

https://dl.dropboxusercontent.com/u/150707256/Raycast%20to%20shoot%20Demo%20playmaker/Raycast%20to%20shoot%20Demo.html

Updates:

New model with texture so we can see the direction we are aiming in (only a basic example).

Gui on screen instructions.

Spawned particles if you hit either a wall or the enemy.

Hopefully this basic example would help others.

Unity Scene: https://dl.dropboxusercontent.com/u/150707256/Raycast%20to%20shoot%20Demo%20playmaker/Raycast%20to%20shoot%20Demo.unity3d







 
« Last Edit: August 24, 2014, 08:46:02 AM by colpolstudios »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14121
  • Official Playmaker Support
    • View Profile
Re: RayCast From GameObject
« Reply #27 on: September 18, 2014, 06:16:13 AM »
Hi,

 Very good :)

It'll go in for sure. I am still bumping into a major issue with the current beta ecosystem as it crashed Unity when you import a package... and I am still unable to understand where I need to change my code so that it doesn't... as soon as I figured that one, then I can release the new version of the ecosystem which will allow you to browser samples and install them without leaving Unity :)

 Bye,

 Jean

 Bye,

 Jean