playMaker

Author Topic: Camera Rifle Set Up  (Read 4268 times)

threedavid

  • Playmaker Newbie
  • *
  • Posts: 18
Camera Rifle Set Up
« on: March 20, 2013, 08:06:11 PM »
Hi,
I've been trying to make heads and tails of all the shooting topics and I'm still scratching my head about it. What I'm trying to put together is a shooting gallery. The camera is the rifle and you shoot at targets that when you hit one, it plays an animation. I'm trying to test out a set up for this, but failed.

The test scene is pretty simple. There is one camera and one NPC target. I was wondering if anyone has a similar Playmaker test scene that they would be willing to share on this thread. I will share mine out once I've got it working.

Thanks,

David

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Camera Rifle Set Up
« Reply #1 on: March 20, 2013, 08:49:21 PM »
Hey!

I'm currently working on the same thing (but from a third person perspective), do you need to see the bullet move towards the target OR simply check if the target would be hit on the same frame of the click/tap?

threedavid

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Camera Rifle Set Up
« Reply #2 on: March 21, 2013, 07:55:25 PM »
Hey LampRabbit,
Regarding bullet, not as of yet, but I'm sure in the future I'll probably need this solution. But for now, all I'm trying to set up is an FPS. And with Alex's immense help, I've got some working. I'm just having some issue with scale and ray distance. For the level test, the close NPCs are getting hit, but the far ones are not.

Does anyone know, is there a way to set the ray to infinite? Or know how the ray distance relates to camera far clipping plane setting?

David

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Camera Rifle Set Up
« Reply #3 on: March 21, 2013, 08:39:48 PM »
An infinte raycast ... would kill whatever game you are making (if its even possible) and would almost likely cap at long long (an extremely high number).

You do know you can set the raydistance ... which I'm sure you could just set to the camera clipping plan. Just checked and the clipping plan has no affect on raycasts.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Camera Rifle Set Up
« Reply #4 on: March 25, 2013, 01:19:09 AM »
Hi,

 don't worry much about raycasting to "infinite", this is not as bad as we think it is for a computer to check very far from the camera, and actually not difficult at all.

the simple way out is to check what is your far clipping distance and have the same distance set in your raycast.  Also since you will only raycast when the user shoot, you will be fine, cause you need one raycast from time to time.

your need is very simple, so it is likely a simple problem. Have you checked the various examples I did with raycast on this forum?

this one should be the right one:

http://hutonggames.com/playmakerforum/index.php?topic=900.msg3781#msg3781



bye,

 Jean