Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
Member [Lv. 1]
Member [Lv. 1]
Posts : 4
Points : 992
Rep : 0
Join date : 2015-11-08
View user profile

[HELP] Titanfall-like wallrunning script

on Sun Nov 08, 2015 8:06 pm
I need help creating a wallrunning script similar to titanfall
Member [Lv. 1]
Member [Lv. 1]
Posts : 4
Points : 992
Rep : 0
Join date : 2015-11-08
View user profile

Re: [HELP] Titanfall-like wallrunning script

on Tue Nov 10, 2015 7:52 pm
Anyone have any scripts/links to scripts?
(I'm a n00b with scripting)
Member [Lv. 0]
Member [Lv. 0]
Posts : 1
Points : 996
Rep : 1
Join date : 2015-11-01
View user profile

the noob option

on Thu Nov 12, 2015 2:35 am
Message reputation : 100% (1 vote)
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
Member [Lv. 2]
Member [Lv. 2]
Posts : 6
Points : 914
Rep : 0
Join date : 2016-01-30
View user profile

Re: [HELP] Titanfall-like wallrunning script

on Sun Feb 21, 2016 3:52 pm
#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
Member [Lv. 0]
Member [Lv. 0]
Posts : 1
Points : 436
Rep : 0
Join date : 2017-05-12
View user profile

Re: [HELP] Titanfall-like wallrunning script

on Sat May 13, 2017 12:00 am
#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;

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