playMaker

Author Topic: Player Push (rotate) a Sphere w/o a Rigid Body [SOLVED]  (Read 1475 times)

MarkD

  • Full Member
  • ***
  • Posts: 113
Player Push (rotate) a Sphere w/o a Rigid Body [SOLVED]
« on: April 06, 2017, 02:06:16 AM »
Hey guys,

In my scene, I'm trying to figure out how to have the player "push" a sphere around.  The design calls for the player to be "connected" to the sphere at all times.  If you've ever played "Tomb Raider Guardian of Light" you'll recognize ta similar type of design: 
So for that reason, I think what makes the most sense is to parent the sphere to the player and then rotate the sphere in the direction the player is moving rather than relying on force actions which will just push the sphere away from the player.

The part I'm having trouble with is getting the rotation right. I can get the sphere to rotate, but it doesn't look like it's being "pushed" in the right direction.

I've attempted several ideas but none of them seem to be working.

Any one out there have any suggestions on how they'd go about solving this?
« Last Edit: April 07, 2017, 01:16:14 PM by MarkD »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Player Push (rotate) a Sphere w/o a Rigid Body
« Reply #1 on: April 07, 2017, 04:58:52 AM »
Hi,

 without physics it's difficult, very tricky indeed. You would need to create a dummy acting as the center of the sphere and pointing at the right direction of movement and have your sphere rotate around that axis, but of the right angle which is tricky to get, unless you are good with math ( the distance travel is what the sphere as to travel on its perimeter).

 I would suggest using physics instead.

 Bye,

 Jean

MarkD

  • Full Member
  • ***
  • Posts: 113
Re: Player Push (rotate) a Sphere w/o a Rigid Body [SOLVED]
« Reply #2 on: April 07, 2017, 01:18:11 PM »
Yeah, maybe too hard.  I realized last night that "Add force" was doing everything I wanted it to do in terms of moving the sphere in the right direction.  The only downside was that it was moving the sphere away from the player.

Then I realized that I could, duh, add some position constraints to the rigidbody and the problem is solved.

:)

Thanks guys!