3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: SCRIPT HELP  (Read 1338 times)

« on: September 18, 2009, 04:26:25 PM »
hello, i need a script that puts a character in the spot of another object when u press a key
please help me, i will offer credit for  my new game 8)
« Reply #1 on: September 18, 2009, 06:31:41 PM »
link the character to the object and hide it, when you press the key (EvenOnInput) hide the object and show the character. you dont need a script for that.

if by character you mean a letter... im afraid textPrint wont work the way I told you to do because its position is relative to the screen and not to the tridimentional space where your objects are, and at least the camera is static... the scenario will move (along with your object) and the character will stay in the same screen location. in this case, you should put the character in a skinmesh, setup it as billboard and follow the procedure I told you before.

good luck!

------------
EDIT:
only link the character to the object may not work as I expect (the object drag the character). you may have to make a group which include both (I should test this to give you the certain advice but I dont want to, test that yourself). Also, both objects (the 'object' and the 'character') should start (be) in the same location.
ALSO, dont forget ofcourse to link the 'object' and the 'character' to the EvenOnInput :D

now Im done.  :)
« Last Edit: September 18, 2009, 08:22:24 PM by loop »
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #2 on: September 18, 2009, 11:42:33 PM »
ok, heres a more detailed explanation: ok say  i had a character (not a letter) and a car, when i touch the car ive already made teh camera follow the car and the player dissapears, giving me controll of the car too, but when i press enter(which i set) to the the opposite, the character is back where  i first got in the car, do u thing  u could help
« Reply #3 on: September 18, 2009, 11:55:03 PM »
ok, heres a more detailed explanation: ok say  i had a character (not a letter) and a car, when i touch the car ive already made teh camera follow the car and the player dissapears, giving me controll of the car too, but when i press enter(which i set) to the the opposite, the character is back where  i first got in the car, do u thing  u could help
nevermind  i found out how to link the characters sphere rigidbody with the car so its actually there but acts like it isnt
« Reply #4 on: September 19, 2009, 02:00:00 PM »
ok, let's script it.

take a look at http://www.3drad.com/Script_reference.php

iObjectLocation(OBJ_X,Vector3)
get the location for the car

iObjectLocationSet(OBJ_X,Vector3)
set the location for the character

so the code would be something like this
Code: [Select]
Vector3 characterLocation;
void Main()
{
   iObjectLocation(OBJ_car,characterLocation);
   iObjectLocationSet(OBJ_character,characterLocation);
}

the only problem with that is that gonna place the character in the exactly same location the car is so will superimpose both.
you should change a little the location for the character.

Im attaching a file with the job done. have fun.
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #5 on: September 23, 2009, 04:47:27 AM »
This is working with a mesh, but how do you use "iObjectLocationSet" with a "character"?
« Reply #6 on: September 23, 2009, 12:03:40 PM »
Yes it work...
But there is a black screen effect as if 3Drad didn't liked it :)
Pages: [1]