playMaker

Author Topic: Get Vector3 from screen touch  (Read 2433 times)

Horror

  • Junior Playmaker
  • **
  • Posts: 79
Get Vector3 from screen touch
« on: June 30, 2012, 11:57:01 AM »
It's me again! And I'm befuddled once more ???

I'm trying to do a raycast from the camera view to a location in the scene relative to where the screen was touched. In my game you touch the screen to shoot, so ideally I'd like to be able to spawn sparks/blood/explosions at the location you shot at.

By the look of it Get Touch Info only allows me to specify 2 axis, and Touch Object Event requires you to specify an object to touch. But what if I shoot a wall or something? How can I store that as a Vector3?

Cheers :)


EDIT: I suppose I could add a Touch Object Event to the environment to get my Vector3... or is that a bit dodgy?
« Last Edit: June 30, 2012, 12:09:27 PM by Horror »

sinman

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Get Vector3 from screen touch
« Reply #1 on: July 25, 2012, 03:59:16 AM »
Have you tried the Raycast action?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Get Vector3 from screen touch
« Reply #2 on: July 25, 2012, 07:06:50 AM »
Seems like you could make use of the same vector 3 thats aiming the weapon to help create the FX. Are you creating new objects for the projectiles? I I've been using the collision info and set parent to create the FX, whatever method you're using to identify impact should work. I cant really get a clear picture in my head of what you're describing.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D