FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

description[HELP] Titanfall-like wallrunning script

more_horiz
I need help creating a wallrunning script similar to titanfall

descriptionRe: [HELP] Titanfall-like wallrunning script

more_horiz
Anyone have any scripts/links to scripts?
(I'm a n00b with scripting)

descriptionthe noob option

more_horiz
Hi RAZ3, a am also a noob at scripting and what you are asking for is pretty high level stuff, you could however attempt to make a wall running animation and set up box colliders on the walls you wish to run on and checking the is trigger box. by using a script that tells the animation to play when the character enters the collider you could have it appear as if the player is wall running but it will not be able to adapt to different lengths of wall.

public animator anim

void start()
{
anim = getcomponent<animator>
}
void onTriggerEnter()
{
anim.play("nameofanimation", -1, 0f);
}

/// script is a guide only and will not work without setting up an animator first, also the whole public class stuff isn't there either, but good luck

descriptionRe: [HELP] Titanfall-like wallrunning script

more_horiz
#pragma strict
var MainPlayer : GameObject;
function Start () {

}

function Update () {

}

function OnTriggerEnter (info : Collider){
MainPlayer.rigidbody.useGravity = false;
}
function OnTriggerExit (info : Collider){
MainPlayer.rigidbody.useGravity = true;
}


use this just make a second collider and set it as trigger put on script assign mainplayer and vola your done

descriptionRe: [HELP] Titanfall-like wallrunning script

more_horiz
#pragma strict

var MainPlayer : GameObject;
var MainPlayerVars : PlayerMovementScript;

function OnTriggerEnter ( hit : Collider)
{
if (Input.GetButtonDown("Run") && hit.gameObject.tag == "wall")
MainPlayer.rigidbody.useGravity = false;
MainPlayerVars.grounded = true;
MainPlayerVars.wallRunRight = true;

}

function OnTriggerExit ( hit : Collider)
{
MainPlayer.rigidbody.useGravity = true;
MainPlayerVars.grounded = false;
MainPlayerVars.wallRunRight = false;

}

function OnTriggerStay ( hit : Collider)
{
if (Input.GetButton("Run") && hit.gameObject.tag == "wall")
MainPlayer.rigidbody.useGravity = false;
MainPlayerVars.grounded = true;
MainPlayerVars.wallRunRight = true;

}
Permissions in this forum:
You cannot reply to topics in this forum