UnityNinja Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

UnityNinja CommunityLog in

UnityNinja - Video Game Development Community, including Resources, Forums, Marketplace & More.


description[HELP] Titanfall-like wallrunning script Empty[HELP] Titanfall-like wallrunning script

more_horiz
I need help creating a wallrunning script similar to titanfall

description[HELP] Titanfall-like wallrunning script EmptyRe: [HELP] Titanfall-like wallrunning script

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

description[HELP] Titanfall-like wallrunning script Emptythe 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

description[HELP] Titanfall-like wallrunning script EmptyRe: [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

description[HELP] Titanfall-like wallrunning script EmptyRe: [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;

}

description[HELP] Titanfall-like wallrunning script EmptyRe: [HELP] Titanfall-like wallrunning script

more_horiz
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum
power_settings_newLogin to reply