playMaker

Author Topic: Raycasting and Normals  (Read 2813 times)

neroki

  • Playmaker Newbie
  • *
  • Posts: 7
Raycasting and Normals
« on: February 24, 2012, 06:23:28 PM »
I'm new to Unity scripting altogether but I understand the concept of raycasting. And I feel like I am on the right track with this.

Let's say I had third person controller inside of a large box-shaped room with rounded edges and corners. I want the entire room to rotate as he walks up one of the rounded edges to give the illusion of walking on the walls and ceiling.

How do I set it up?
« Last Edit: February 24, 2012, 07:17:08 PM by neroki »

neroki

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Raycasting and Normals
« Reply #1 on: February 25, 2012, 09:51:54 AM »
Please help. This is driving me insane

If someone can tell me how to match an objects rotation to a normals rotation I can figure the rest out

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Raycasting and Normals
« Reply #2 on: February 27, 2012, 08:00:56 AM »
Hi,

 take a look at this:

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

it shows how to align an object on the surface hit by the raycast


your implementation would need to raycast from the very same object that is aligned to the surface and done.

 Tell me if that helps, else I'll try to find the time to make a working version of your query.

 Bye,

 Jean

neroki

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Raycasting and Normals
« Reply #3 on: March 02, 2012, 12:30:54 PM »
Jean

I'm still not doing something right and I'm not sure what it is.

I've included an example scene with a rounded cube room, a third person controller, and an object to raycast from. I don't know how to include the script without including playmaker as well. But, it is the same sort of script from the example from the link you posted.

If you can find time to make a working version I will be eternally grateful!

http://www.mediafire.com/?1crrv6tbj0v6sjl
« Last Edit: March 02, 2012, 12:33:06 PM by neroki »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Raycasting and Normals
« Reply #4 on: March 25, 2013, 01:24:03 AM »
Hi,

 The link is dead, I wanted to check it out. Have you been able to solve this?

bye,

 Jean