|
Post by heatadvisory on May 26, 2016 21:41:26 GMT
Working Jump Script! You need to connect script to event on contact set to monitor ground rigidbody and monitor player rigidbody so you can only jump when touching ground. void Main() {
if(iKeyDown(iKeyCode("DIK_space"))&& IN_22!=0) { Vector3 curVelocity; iObjectVelocity(OBJ_0,curVelocity); iObjectVelocitySet(OBJ_0,Vector3(0,18,0)+curVelocity); } }
|
|
|
Post by commended on May 31, 2016 9:19:50 GMT
Does it work with Cam1stPerson??
|
|
|
Post by WhyNot on May 31, 2016 9:56:33 GMT
I guess it will
|
|
|
Post by commended on Jun 1, 2016 11:10:50 GMT
heatadvisory It's not working(with character), also it's halved my frame rate!!
|
|
|
Post by NicusorN5 on Jun 1, 2016 13:27:25 GMT
Can you give me the script? lol
|
|
|
Post by rock on Jun 1, 2016 16:19:03 GMT
NicusorN5 here is your script bro! void Main() {
if(iKeyDown(iKeyCode("DIK_space"))&& IN_22!=0) { Vector3 curVelocity; iObjectVelocity(OBJ_0,curVelocity); iObjectVelocitySet(OBJ_0,Vector3(0,18,0)+curVelocity); } }
|
|
|
Post by NicusorN5 on Jun 1, 2016 17:49:41 GMT
Hmmm,lemme try edit this script:
void Main() {
if(iKeyDown(iKeyCode("DIK_space"))&& IN_22!=0) { Vector3 curVelocity; iObjectVelocity(OBJ_0,curVelocity); Vector3 NewVelocity (0,18,0); NewVelocity.x += 0; NewVelocity.y += curVelocity.y NewVelocity.x += 0; iObjectVelocitySet(OBJ_0,NewVelocity); } } I don't tested this script.Give it a try!
|
|
|
Post by foxmanreal on Mar 15, 2017 1:27:24 GMT
I believe I may have the solution to the CamFirstPerson Jump Script. I'm no expert--nor proficient-but I put this one together. I hope it helps!
void Main()
{
if (iKeyDown(iKeyCode("DIK_D"))&&IN_0!=0)
iObjectStart(OBJ_22);
}
Where IN_0= EventOnContact OBJ_22=Velocity
"D" was arbitrarily chosen as the Input Key.
|
|
|
Post by NicusorN5 on Mar 15, 2017 14:12:49 GMT
Yeah... The player can use it to spam the "D" key and spam it lol
|
|
|
Post by zerochaos98 on Jul 1, 2017 1:32:06 GMT
Ok the scripted version of this is cool but i just thought id share my version of the non scripted jump here.what you do is take your characters rigidbody place a force object facing straight up right on top of that rigid body... Then you go into the force object set it about (75) or (80) and change the timer to (0.3).... Now use the eventon contact to monitor the character rigidbody and the ground ... The use an event on input and set it to ""startontinput"" The force object and in the event on contact set it to STOP ON NO-CONTACT finally set the no conteact threshhold to (0.1).....aannnd DONE
Sorry wasnt sure if it was cool of me to put that here just thought id share what i use for my projects
Ps for the fps camera simply replace CHARACTER RIGIDBODY with FIRSTPERSONCAMERA in my instructions It also does not allow jump spamming
|
|