playMaker

Author Topic: Tilt in playmaker  (Read 3285 times)

berir

  • Playmaker Newbie
  • *
  • Posts: 25
Tilt in playmaker
« on: June 09, 2014, 11:23:47 PM »
Hey Guys,

I would really appreciate if someone could tell me if there is a way to recreate
this in playmaker

it is ship movement script from unity tutorial;

Code: [Select]
using UnityEngine;
using System.Collections;

[System.Serializable]
public class Boundary     
{
public float xMin, xMax, zMin, zMax;
}

public class PlayerController : MonoBehaviour
{
public float speed;
public float tilt;
public Boundary boundary;

void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");

Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rigidbody.velocity = movement * speed;

rigidbody.position = new Vector3
(
Mathf.Clamp (rigidbody.position.x, boundary.xMin, boundary.xMax),
0.0f,
Mathf.Clamp (rigidbody.position.z, boundary.zMin, boundary.zMax)
);

rigidbody.rotation = Quaternion.Euler (0.0f, 0.0f, rigidbody.velocity.x * -tilt);
}
}

thank you in advance
« Last Edit: June 16, 2014, 08:41:05 PM by berir »

berir

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Making This script work in playmaker
« Reply #1 on: June 16, 2014, 08:40:31 PM »
Hey Guys I am desperate for some help here ...

what I really need is to know how to make a space ship tilt when moving left and right ... but using mouse / tap input instead of arrow keys

It is a simple classic space - shooter controller similar to space invaders , ship can only move left /right/ up and dawn... and it does not rotate ... But I would love to have it tilt when moving left or right 

Thanks

Beri

« Last Edit: June 16, 2014, 08:43:52 PM by berir »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tilt in playmaker
« Reply #2 on: June 17, 2014, 06:36:04 AM »
Hi,

 I am so sorry. I actually did it last week, and forgot to mention it to you... :)

 I am holiday,so allow me some more time to get round this, but basically, it's all there, with a scene and all is working properly.

 Bye,

 Jean

berir

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Tilt in playmaker
« Reply #3 on: June 17, 2014, 10:31:38 AM »
thanks looking forward to it

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tilt in playmaker
« Reply #4 on: June 18, 2014, 04:14:28 PM »

berir

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Tilt in playmaker
« Reply #5 on: June 26, 2014, 10:00:19 PM »
Hi Jean , any luck in making a ship tilt with click to move input

I am going insane over here ... been trying for months to come up with some solution , but nothing is working ....:(

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Tilt in playmaker
« Reply #6 on: June 27, 2014, 02:13:28 AM »
Hi,

 is the sample above not what you are looking for?

 Bye,

 Jean