Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made better system for platform.3 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
//Edited 10/27/2015 by Brent Dalling of 404ERRORTEAM
//In Edit I introduced a system so that the platform moves only when collided with. This means that the platform will stay in positions until Player is in contact with the platform.
//This project file will also need a way for the platform to "reset" after the player is not in contact for x seconds.

var targetA : GameObject;
var targetB : GameObject;

var platform : GameObject;
var speed : float = 0.1;

function FixedUpdate () {
function OnCollisionEnter (Collision : platform ) {
var weight = Mathf.Cos(Time.time * speed * 2 * Mathf.PI) * 0.5 + 0.5;
transform.position = targetA.transform.position * weight
+ targetB.transform.position * (1-weight);
Expand Down