PlayMaker Help & Tips > VR Help

Problem with raycasting from child of controller

(1/3) > >>

BDFgames:
Hi there. I've got a problem where raycasting from a game object (specifically, a gun model's bullet spawn point) always seems to use the localspace coordinates, the result of which is that the ray's origin is always 0, 0, 0 (the centre-floor of the Vive play area).

It doesn't seem to matter if I try to use the bullet spawn point as a "hardcoded" Game Object or create a Game Object variable and refer to that, I just can't seem to get it to draw the ray from the actual Game Object -- it always draws it from the floor.

Even weirder, I seemed to "fix" this problem a week ago in one scene (by accident -- I have no idea what I did, but it seemingly started working as you'd expect it to), but when I copy the exact same SteamVR camera rig into a new scene, the origin problem occurs again.  :S

I know this has to be user-error on my part, but I'm stuffed if I can figure out what I'm doing wrong.

Any hints or tips gratefully received. Thanks in advance for your help.  :)

BDFgames:
Please forgive the bump. I take it no one's seen this problem before?  :(

Here's a screenshot, in case it helps.

jeanfabre:
Hi,

 can you show your raycasting action setup?

how do you compute the direction itself?

Bye,

 Jean

BDFgames:
Hi Jean. Thanks for your help.  :)

Here are a few screenshots of the FSM, action and relevant Game Objects. Hope this gives some context.

jeanfabre:
Hi,

 ok, thanks. so you do indeed have "Self" turned on, so this will be using the direction 0,1,0 from that "bullet spawn point".

 if that's not what you want, then you first need to compute the direction prior using this action, and turn the space property to "world", then you can fire a ray to any position, regardless of the local space.

Bye,

 Jean

Navigation

[0] Message Index

[#] Next page

Go to full version