playMaker

Author Topic: Help with logic, I'm stuck! [SOLVED]  (Read 1405 times)

Hexkonst

  • Playmaker Newbie
  • *
  • Posts: 9
Help with logic, I'm stuck! [SOLVED]
« on: April 04, 2018, 11:05:33 AM »
Hi,
Can someone help me with pseudo code regarding camera collision for a third person camera system?

Hierarchy:
Cam Pivot Object > Camera Pos Object > Main Camera

I use the pivot to rotate the camera, and the pos object for the default camera position.

I can't wrap my head around how I should use the raycast to update the camera's position without creating infinite loops that keep updating the same position.

Any help would be wonderful.
« Last Edit: April 06, 2018, 01:01:35 PM by djaydino »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help with logic, I'm stuck!
« Reply #1 on: April 05, 2018, 02:42:57 AM »
Hi,

 should it not be first the position, then the pivot as a child of position and then the camera as a child of pivot?

 Position - Pivot - Camera

 else as you move the pivot stays in place and your radius of pivot increase with the position distance.

Have you tried Cinemachine? it has all of these build in really... I would give it a go before trying to do a camera collision detection extension.



Else, I would first do a bit a research on Unity forum and Unity Answer, if you find something that works, then I can turn it into playmaker. Let me know what you find.

 Bye,

 Jean

Hexkonst

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Help with logic, I'm stuck!
« Reply #2 on: April 06, 2018, 09:11:33 AM »
Ah, simple and easy solution. Thank you very much! :)