Gracias
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Páginas1
#2
General (Antiguo) / JUEGO: PewPewPew Version[1.5b]
Diciembre 13, 2015, 06:56:26 PMCita de: ll FENEX ll date=1416374913" data-ipsquote="" data-cite="ll FENEX ll" class="ipsQuote">#3General (Antiguo) / Unir dos objetos cuando chocan
Noviembre 13, 2015, 09:16:09 PMCita de: gele81 date=1379074613" data-ipsquote="" data-cite="gele81" class="ipsQuotellevo dándole weltas a esto y no consigo hacer lo del joint. lo otro si me sale, pero como estoy intentando más que nada aprender. Me he empeziñao en intentar el Joint. os pongo el codigo //para saber si colisiona con el balon function OnCollisionEnter(collision: Collision){ if (collision.gameObject == balon) parada(); } // esto se encarga de pegar el balon al portero function parada(){ portero.AddComponent(HingeJoint); hingeJoint.connectedBody = balon.rigidbody; } no me da error pero no se keda pegado ni na un saludo y muchas gracia¿s.¿Y como has hecho para animar los saltos del portero? Tengo unos cubos en cada zona de salto y un script que activa la animación correcpondiente al pasar el balón, pero es que con animations me funciona pero luego se pone a dar volteretas y con animator no consigo activar las animaciones.Gracias por adelantado.
#4
General (Antiguo) / Fallo con script para subir y bajar coche (u otro vehículo)
Septiembre 30, 2015, 10:11:14 PM
Aquí está terminado y probado y va con todo tipo de coches,OJO, que si usais otro script de conducir tendréis que cambiarlo en las partes que se indica, gracias por la ayuda.var alladopuerta : boolean = false;
var conduciendo : boolean = false;
var persona : Transform; //personaje
var coche : Transform; //un empty con los scripts de conducir y el modelo del coche dentro
var puerta : Transform; //cubo modo trigger
var puntosalida : Transform; //empty
var camaracoche : Camera;
var camarapersona : Camera;
function Start(){
coche.transform.GetComponent("CarController").enabled=false; //Desactiva el script de conducir.
coche.transform.GetComponent("CarUserControl").enabled=false;
camaracoche.enabled = false; //descativa la camara del coche
}
function Entrar()
{
if(alladopuerta){
GetComponent.<GUIText>().text = "pulsa E para entrar";
}
}
function OnTriggerEnter(Player : Collider)
{
Debug.Log("Trigger Enter");
alladopuerta = true;
}
function OnTriggerExit(Player : Collider)
{
Debug.Log("Trigger Exit");
alladopuerta = false;
}
function Update()
{
if(alladopuerta){
GetComponent.<GUIText>().text = "pulsa E para entrar";
if(Input.GetButtonDown("Use")) {
conduciendo = true;
alladopuerta= false;
}}
if(conduciendo){
persona.gameObject.SetActive(false);
// parent player to Exit Point
persona.parent = puntosalida.transform;
persona.transform.localPosition = Vector3(-1.5,0,0);
// parent PlayerParent to car
puntosalida.parent = coche.transform;
puntosalida.transform.localPosition = Vector3(-0.3,1.5,-0.65);
// coche.transform.GetComponent("scriptconducir").enabled=true;
coche.transform.GetComponent("CarController").enabled=true;
coche.transform.GetComponent("CarUserControl").enabled=true;
camaracoche.enabled = true; //Enables the carCamera
}else if(Input.GetKeyDown("e")) {
persona.gameObject.SetActive(true);
persona.GameObject.SetActive = true;
persona.transform.parent = null; puntosalida.parent = coche.transform;
coche.transform.GetComponent("CarController").enabled=false;
coche.transform.GetComponent("CarUserControl").enabled=false;
camarapersona.enabled = true;
camaracoche.enabled = false;
}
if(Input.GetKeyDown("r")) {
conduciendo = false;
persona.gameObject.SetActive(true);
persona.transform.parent = null;
puntosalida.parent = puerta.transform;coche.transform.GetComponent("CarController").enabled=false;
coche.transform.GetComponent("CarUserControl").enabled=false;
camarapersona.enabled = true;
camaracoche.enabled = false;
}
}
http://unityspain.com/applications/core/interface/file/attachment.php?id=8512">EntrarVehiculos.js
var conduciendo : boolean = false;
var persona : Transform; //personaje
var coche : Transform; //un empty con los scripts de conducir y el modelo del coche dentro
var puerta : Transform; //cubo modo trigger
var puntosalida : Transform; //empty
var camaracoche : Camera;
var camarapersona : Camera;
function Start(){
coche.transform.GetComponent("CarController").enabled=false; //Desactiva el script de conducir.
coche.transform.GetComponent("CarUserControl").enabled=false;
camaracoche.enabled = false; //descativa la camara del coche
}
function Entrar()
{
if(alladopuerta){
GetComponent.<GUIText>().text = "pulsa E para entrar";
}
}
function OnTriggerEnter(Player : Collider)
{
Debug.Log("Trigger Enter");
alladopuerta = true;
}
function OnTriggerExit(Player : Collider)
{
Debug.Log("Trigger Exit");
alladopuerta = false;
}
function Update()
{
if(alladopuerta){
GetComponent.<GUIText>().text = "pulsa E para entrar";
if(Input.GetButtonDown("Use")) {
conduciendo = true;
alladopuerta= false;
}}
if(conduciendo){
persona.gameObject.SetActive(false);
// parent player to Exit Point
persona.parent = puntosalida.transform;
persona.transform.localPosition = Vector3(-1.5,0,0);
// parent PlayerParent to car
puntosalida.parent = coche.transform;
puntosalida.transform.localPosition = Vector3(-0.3,1.5,-0.65);
// coche.transform.GetComponent("scriptconducir").enabled=true;
coche.transform.GetComponent("CarController").enabled=true;
coche.transform.GetComponent("CarUserControl").enabled=true;
camaracoche.enabled = true; //Enables the carCamera
}else if(Input.GetKeyDown("e")) {
persona.gameObject.SetActive(true);
persona.GameObject.SetActive = true;
persona.transform.parent = null; puntosalida.parent = coche.transform;
coche.transform.GetComponent("CarController").enabled=false;
coche.transform.GetComponent("CarUserControl").enabled=false;
camarapersona.enabled = true;
camaracoche.enabled = false;
}
if(Input.GetKeyDown("r")) {
conduciendo = false;
persona.gameObject.SetActive(true);
persona.transform.parent = null;
puntosalida.parent = puerta.transform;coche.transform.GetComponent("CarController").enabled=false;
coche.transform.GetComponent("CarUserControl").enabled=false;
camarapersona.enabled = true;
camaracoche.enabled = false;
}
}
http://unityspain.com/applications/core/interface/file/attachment.php?id=8512">EntrarVehiculos.js
#5
General (Antiguo) / Fallo con script para subir y bajar coche (u otro vehículo)
Septiembre 23, 2015, 08:47:14 PM
Cambié lo de los gameobject y me di cuenta que el fallo era que estaba mal escrito la parte de desactivar el personaje y activar la cámara del coche (pero el script de conducir no se activa, tiene que estar siempre activo, por eso los aparcados no van)
#6
General (Antiguo) / Fallo con script para subir y bajar coche (u otro vehículo)
Septiembre 22, 2015, 09:58:36 PM
Ya va muchas gracias (con coches aparcados no va, pero me las apañare) llevaba un tiempo estancado ahí
#7
General (Antiguo) / Fallo con script para subir y bajar coche (u otro vehículo)
Septiembre 21, 2015, 04:18:29 PM
Vale gracias que no sabia depurar
#8
General (Antiguo) / Fallo con script para subir y bajar coche (u otro vehículo)
Septiembre 20, 2015, 01:29:42 PM
He cambiado eso pero sigue sin ir
#9
General (Antiguo) / Fallo con script para subir y bajar coche (u otro vehículo)
Septiembre 08, 2015, 10:16:35 PM
Por favor necesito ayuda, soy un poco torpe (y nuevo) programando y he hecho un script para subir y bajar de un coche (u otro vehículo), y no va, pero no se que falla.¿ alguien podría decírmelo por favor?Es el siguiente (está en js) :var alladopuerta : boolean = false;
var conduciendo : boolean = false;
var persona : Transform;
var coche : Transform;
var puerta : Transform;
var puntosalida : Transform;
var camaracoche : Camera;
var camarapersona : Camera;
function Entrar()
{
if(alladopuerta){
GetComponent.<GUIText>().text = "pulsa E para entrar";
}
}
function OnTriggerEnter(Player : Collider)
{
Debug.log("Trigger Enter");
alladopuerta = true;
}
function OnTriggerExit(Player : Collider)
{
Debug.log("Trigger Exit");
alladopuerta = false;
}
function Update()
{
if(Input.GetbuttonDown("Use") && alladopuerta) {
conduciendo = true;
}
if(conduciendo){
persona.GameObject.SetActive(false);
persona.GameObject.SetActive = false;
// parent player to Exit Point
persona.parent = puntosalida.transform;
persona.transform.localPosition = Vector3(-1.5,0,0);
// parent PlayerParent to car
puntosalida.parent = coche.transform;
puntosalida.transform.localPosition = Vector3(-0.3,1.5,-0.65); //Driverside exit point, adjust accordingly per vehicle.
// GameObject.Find("VehicleObjectName").GetComponent("DrivingScriptHere").enabled=true;
GameObject.Find("Car").GetComponent("CarController").enabled=true;
GameObject.Find("Car").GetComponent("CarUserControl").enabled=true; //Enables the script component to operate Vehicle.
camarapersona.enabled = false; //Disables the playerCamera
camaracoche.enabled = true; //Enables the carCamera
}else{
// make character visible again
persona.GameObject.SetActive(true);
persona.GameObject.SetActive = true;
// unparent player from everything
persona.transform.parent = null;
// exitPoint.parent = doorTriggerLeft.transform;
// parent Exit Point to car gameobject
puntosalida.parent = coche.transform;
// GameObject.Find("VehicleObjectName").GetComponent("DrivingScriptHere").enabled=false;
GameObject.Find("Car").GetComponent("CarController").enabled=false; //Disables the script component to park Vehicle.
GameObject.Find("Car").GetComponent("CarUserControl").enabled=false;
camarapersona.enabled = true; //re-enables player camera
camaracoche.enabled = false; //disables car camera
}
if(Input.GetbuttonDown("Use") && conduciendo) {
conduciendo = false; }
} GRACIAS por adelantado, un saludo
http://unityspain.com/applications/core/interface/file/attachment.php?id=8413">EntrarVehiculos.js
var conduciendo : boolean = false;
var persona : Transform;
var coche : Transform;
var puerta : Transform;
var puntosalida : Transform;
var camaracoche : Camera;
var camarapersona : Camera;
function Entrar()
{
if(alladopuerta){
GetComponent.<GUIText>().text = "pulsa E para entrar";
}
}
function OnTriggerEnter(Player : Collider)
{
Debug.log("Trigger Enter");
alladopuerta = true;
}
function OnTriggerExit(Player : Collider)
{
Debug.log("Trigger Exit");
alladopuerta = false;
}
function Update()
{
if(Input.GetbuttonDown("Use") && alladopuerta) {
conduciendo = true;
}
if(conduciendo){
persona.GameObject.SetActive(false);
persona.GameObject.SetActive = false;
// parent player to Exit Point
persona.parent = puntosalida.transform;
persona.transform.localPosition = Vector3(-1.5,0,0);
// parent PlayerParent to car
puntosalida.parent = coche.transform;
puntosalida.transform.localPosition = Vector3(-0.3,1.5,-0.65); //Driverside exit point, adjust accordingly per vehicle.
// GameObject.Find("VehicleObjectName").GetComponent("DrivingScriptHere").enabled=true;
GameObject.Find("Car").GetComponent("CarController").enabled=true;
GameObject.Find("Car").GetComponent("CarUserControl").enabled=true; //Enables the script component to operate Vehicle.
camarapersona.enabled = false; //Disables the playerCamera
camaracoche.enabled = true; //Enables the carCamera
}else{
// make character visible again
persona.GameObject.SetActive(true);
persona.GameObject.SetActive = true;
// unparent player from everything
persona.transform.parent = null;
// exitPoint.parent = doorTriggerLeft.transform;
// parent Exit Point to car gameobject
puntosalida.parent = coche.transform;
// GameObject.Find("VehicleObjectName").GetComponent("DrivingScriptHere").enabled=false;
GameObject.Find("Car").GetComponent("CarController").enabled=false; //Disables the script component to park Vehicle.
GameObject.Find("Car").GetComponent("CarUserControl").enabled=false;
camarapersona.enabled = true; //re-enables player camera
camaracoche.enabled = false; //disables car camera
}
if(Input.GetbuttonDown("Use") && conduciendo) {
conduciendo = false; }
} GRACIAS por adelantado, un saludo
http://unityspain.com/applications/core/interface/file/attachment.php?id=8413">EntrarVehiculos.js
Páginas1