Realistic fps prefab tenho esses erros ao tentar colocar um script de entrar sair do carro
2 participantes
Página 1 de 1
Realistic fps prefab tenho esses erros ao tentar colocar um script de entrar sair do carro
Assets/VehicleInteractRFPS.cs(76,74): error CS1061: Type `FPSRigidBodyWalker' does not contain a definition for `VisibleBody' and no extension method `VisibleBody' of type `FPSRigidBodyWalker' could be found. Are you missing an assembly reference?
Assets/VehicleInteractRFPS.cs(79,87): error CS1061: Type `FPSRigidBodyWalker' does not contain a definition for `displayVisibleBody' and no extension method `displayVisibleBody' of type `FPSRigidBodyWalker' could be found. Are you missing an assembly reference?
Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using EVP;
///NOTES
/// Set this object tag to Usable, ensure Vehicle Camera is not tagged as MainCamera
///
namespace Vehicle
{
public class VehicleInteractRFPS : MonoBehaviour {
#region Variables - Edy's
VehicleStandardInput m_VehicleStandardInput;
VehicleCameraController m_VehicleCameraController;
VehicleController m_VehicleController;
Transform m_Target;
#endregion
[Tooltip("Ensure your Vehicle Camera is untagged. If it is tagged as MainCamera, RFPS will not work properly.")]
public GameObject vehicleCamera = null;
[Tooltip("Vehicle Child Game Object which represents the position the player will exit at. If omitted, one will be automatically created.")]
public GameObject exitPosition = null;
bool inVehicle=false;
#region Variables - RFPS
private FPSPlayer FPSPlayerComponent;
GameObject m_Body = null;
bool m_BodyVisible = false;
GameObject m_MainCamera = null;
GameObject m_WeaponCamera = null;
GameObject m_WeaponObj = null;
#endregion
void Awake(){
//Camera Checks and initial setup due to RFPS
Camera tmpCam = null;
if (vehicleCamera.GetComponentInChildren<Camera> (true) != null)
tmpCam = vehicleCamera.GetComponentInChildren<Camera> (true);
if (tmpCam == null)
Debug.Log ("The Vehicle Camera was not found. Please add one!", gameObject);
if (tmpCam.tag == "MainCamera") {
Debug.Log ("The Vehicle Camera is set to MainCamera. This needs to be changed for RFPS", vehicleCamera);
vehicleCamera.SetActive (false);
this.enabled = false;
}
vehicleCamera.GetComponentInChildren<Camera> (true).enabled = false;
vehicleCamera.GetComponentInChildren<AudioListener> (true).enabled = false;
if (this.tag != "Usable") {
Debug.Log ("The tag of this object should be set to Usable to work with RFPS", this);
this.enabled = false;
}
m_MainCamera = Camera.main.gameObject;
m_WeaponCamera = m_MainCamera.transform.GetComponentInParent<ReconfigurePrefab> ().WeaponCamera;
m_WeaponObj = m_MainCamera.transform.GetComponentInParent<ReconfigurePrefab> ().WeaponObj;
}
public virtual void Start(){
//Components on EVP Parent Vehicle
m_VehicleStandardInput = this.GetComponentInParent<VehicleStandardInput>();
m_VehicleStandardInput.enabled = false;
m_VehicleController = this.GetComponentInParent<VehicleController> ();
m_Target = m_VehicleController.transform;
//Components on EVP Camera
m_VehicleCameraController = vehicleCamera.GetComponentInParent<VehicleCameraController> ();
if (m_VehicleCameraController == null)
Debug.Log ("Add a VehicleCameraController to the vehicle camera!", vehicleCamera);
m_VehicleCameraController.enabled = false;
m_VehicleController.throttleInput = 0.0f;
m_VehicleController.brakeInput = 1.0f;
//Exit Position
if(exitPosition == null){
exitPosition = new GameObject("ExitPosition");
exitPosition.transform.SetParent(m_Target);
exitPosition.transform.localPosition = new Vector3(-1f, 0f, 0f);
exitPosition.transform.localRotation = Quaternion.identity;
}
//RFPS
FPSPlayerComponent = m_MainCamera.GetComponent<CameraControl> ().playerObj.GetComponent<FPSPlayer> ();
if (FPSPlayerComponent.gameObject.GetComponent<FPSRigidBodyWalker> ().VisibleBody != null)
m_Body = FPSPlayerComponent.gameObject.GetComponent<FPSRigidBodyWalker> ().VisibleBody;
if (m_Body != null)
m_BodyVisible = FPSPlayerComponent.gameObject.GetComponent<FPSRigidBodyWalker> ().displayVisibleBody;
}
void FixedUpdate()
{
if (inVehicle) {
if (Input.GetButtonDown ("Use"))
ExitVehicle ();
}
}
//RFPS Called Action for Usable Objects - see FPSPlayer
public virtual void ActivateObject()
{
http://Debug.Log ("We've Been Activated");
EnterVehicle ();
inVehicle = true;
}
//Enter Vehicle
public virtual void EnterVehicle()
{
http://Debug.Log ("We Entered Vehicle!");
//RFPS Player
FPSPlayerComponent.gameObject.SetActive(false);
FPSPlayerComponent.transform.SetParent (m_Target);
FPSPlayerComponent.transform.position = m_Target.position;
if (m_BodyVisible) { //If DisplayVisibleBody is true, then handle the body
m_Body.gameObject.SetActive (false);
m_Body.transform.SetParent (m_Target);
m_Body.transform.position = m_Target.position;
}
//RFPS Camera
m_MainCamera.GetComponent<AudioListener> ().enabled = false;
m_MainCamera.GetComponent<Camera>().enabled = false;
m_WeaponCamera.GetComponent<Camera> ().enabled = false;
m_WeaponObj.SetActive (false);
//Vehicle Camera
vehicleCamera.GetComponentInChildren<Camera> (true).enabled = true;
vehicleCamera.GetComponentInChildren<AudioListener> (true).enabled = true;
//EDYS
m_VehicleStandardInput.enabled = true;
m_VehicleCameraController.enabled = true;
UpdateEVPCameraSettings ();
}
//Exit Vehicle
public virtual void ExitVehicle()
{
http://Debug.Log ("We Exited Vehicle!");
inVehicle = false;
//RFPS Player
FPSPlayerComponent.transform.parent = null;
FPSPlayerComponent.transform.position = exitPosition.transform.position;
FPSPlayerComponent.transform.rotation = exitPosition.transform.rotation;
FPSPlayerComponent.gameObject.SetActive(true);
if (m_BodyVisible) { //If DisplayVisibleBody is true, then handle the body
m_Body.transform.parent = null;
m_Body.transform.position = exitPosition.transform.position;
m_Body.transform.rotation = exitPosition.transform.rotation;
m_Body.gameObject.SetActive (true);
}
//RFPS Camera
m_MainCamera.GetComponent<Camera>().enabled = true;
m_MainCamera.GetComponent<AudioListener> ().enabled = true;
m_WeaponObj.SetActive (true);
m_WeaponCamera.GetComponent<Camera> ().enabled = true;
//Vehicle Camera
vehicleCamera.GetComponentInChildren<Camera> (true).enabled = false;
vehicleCamera.GetComponentInChildren<AudioListener> (true).enabled = false;
//EDYS
m_VehicleController.throttleInput = 0.0f;
m_VehicleController.brakeInput = 1.0f;
m_VehicleStandardInput.enabled = false;
m_VehicleCameraController.enabled = false;
}
//User EVP Functionality
void UpdateEVPCameraSettings()
{
m_VehicleCameraController.target = m_Target;
m_VehicleCameraController.ResetCamera();
}
}
}
Assets/VehicleInteractRFPS.cs(79,87): error CS1061: Type `FPSRigidBodyWalker' does not contain a definition for `displayVisibleBody' and no extension method `displayVisibleBody' of type `FPSRigidBodyWalker' could be found. Are you missing an assembly reference?
Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using EVP;
///NOTES
/// Set this object tag to Usable, ensure Vehicle Camera is not tagged as MainCamera
///
namespace Vehicle
{
public class VehicleInteractRFPS : MonoBehaviour {
#region Variables - Edy's
VehicleStandardInput m_VehicleStandardInput;
VehicleCameraController m_VehicleCameraController;
VehicleController m_VehicleController;
Transform m_Target;
#endregion
[Tooltip("Ensure your Vehicle Camera is untagged. If it is tagged as MainCamera, RFPS will not work properly.")]
public GameObject vehicleCamera = null;
[Tooltip("Vehicle Child Game Object which represents the position the player will exit at. If omitted, one will be automatically created.")]
public GameObject exitPosition = null;
bool inVehicle=false;
#region Variables - RFPS
private FPSPlayer FPSPlayerComponent;
GameObject m_Body = null;
bool m_BodyVisible = false;
GameObject m_MainCamera = null;
GameObject m_WeaponCamera = null;
GameObject m_WeaponObj = null;
#endregion
void Awake(){
//Camera Checks and initial setup due to RFPS
Camera tmpCam = null;
if (vehicleCamera.GetComponentInChildren<Camera> (true) != null)
tmpCam = vehicleCamera.GetComponentInChildren<Camera> (true);
if (tmpCam == null)
Debug.Log ("The Vehicle Camera was not found. Please add one!", gameObject);
if (tmpCam.tag == "MainCamera") {
Debug.Log ("The Vehicle Camera is set to MainCamera. This needs to be changed for RFPS", vehicleCamera);
vehicleCamera.SetActive (false);
this.enabled = false;
}
vehicleCamera.GetComponentInChildren<Camera> (true).enabled = false;
vehicleCamera.GetComponentInChildren<AudioListener> (true).enabled = false;
if (this.tag != "Usable") {
Debug.Log ("The tag of this object should be set to Usable to work with RFPS", this);
this.enabled = false;
}
m_MainCamera = Camera.main.gameObject;
m_WeaponCamera = m_MainCamera.transform.GetComponentInParent<ReconfigurePrefab> ().WeaponCamera;
m_WeaponObj = m_MainCamera.transform.GetComponentInParent<ReconfigurePrefab> ().WeaponObj;
}
public virtual void Start(){
//Components on EVP Parent Vehicle
m_VehicleStandardInput = this.GetComponentInParent<VehicleStandardInput>();
m_VehicleStandardInput.enabled = false;
m_VehicleController = this.GetComponentInParent<VehicleController> ();
m_Target = m_VehicleController.transform;
//Components on EVP Camera
m_VehicleCameraController = vehicleCamera.GetComponentInParent<VehicleCameraController> ();
if (m_VehicleCameraController == null)
Debug.Log ("Add a VehicleCameraController to the vehicle camera!", vehicleCamera);
m_VehicleCameraController.enabled = false;
m_VehicleController.throttleInput = 0.0f;
m_VehicleController.brakeInput = 1.0f;
//Exit Position
if(exitPosition == null){
exitPosition = new GameObject("ExitPosition");
exitPosition.transform.SetParent(m_Target);
exitPosition.transform.localPosition = new Vector3(-1f, 0f, 0f);
exitPosition.transform.localRotation = Quaternion.identity;
}
//RFPS
FPSPlayerComponent = m_MainCamera.GetComponent<CameraControl> ().playerObj.GetComponent<FPSPlayer> ();
if (FPSPlayerComponent.gameObject.GetComponent<FPSRigidBodyWalker> ().VisibleBody != null)
m_Body = FPSPlayerComponent.gameObject.GetComponent<FPSRigidBodyWalker> ().VisibleBody;
if (m_Body != null)
m_BodyVisible = FPSPlayerComponent.gameObject.GetComponent<FPSRigidBodyWalker> ().displayVisibleBody;
}
void FixedUpdate()
{
if (inVehicle) {
if (Input.GetButtonDown ("Use"))
ExitVehicle ();
}
}
//RFPS Called Action for Usable Objects - see FPSPlayer
public virtual void ActivateObject()
{
http://Debug.Log ("We've Been Activated");
EnterVehicle ();
inVehicle = true;
}
//Enter Vehicle
public virtual void EnterVehicle()
{
http://Debug.Log ("We Entered Vehicle!");
//RFPS Player
FPSPlayerComponent.gameObject.SetActive(false);
FPSPlayerComponent.transform.SetParent (m_Target);
FPSPlayerComponent.transform.position = m_Target.position;
if (m_BodyVisible) { //If DisplayVisibleBody is true, then handle the body
m_Body.gameObject.SetActive (false);
m_Body.transform.SetParent (m_Target);
m_Body.transform.position = m_Target.position;
}
//RFPS Camera
m_MainCamera.GetComponent<AudioListener> ().enabled = false;
m_MainCamera.GetComponent<Camera>().enabled = false;
m_WeaponCamera.GetComponent<Camera> ().enabled = false;
m_WeaponObj.SetActive (false);
//Vehicle Camera
vehicleCamera.GetComponentInChildren<Camera> (true).enabled = true;
vehicleCamera.GetComponentInChildren<AudioListener> (true).enabled = true;
//EDYS
m_VehicleStandardInput.enabled = true;
m_VehicleCameraController.enabled = true;
UpdateEVPCameraSettings ();
}
//Exit Vehicle
public virtual void ExitVehicle()
{
http://Debug.Log ("We Exited Vehicle!");
inVehicle = false;
//RFPS Player
FPSPlayerComponent.transform.parent = null;
FPSPlayerComponent.transform.position = exitPosition.transform.position;
FPSPlayerComponent.transform.rotation = exitPosition.transform.rotation;
FPSPlayerComponent.gameObject.SetActive(true);
if (m_BodyVisible) { //If DisplayVisibleBody is true, then handle the body
m_Body.transform.parent = null;
m_Body.transform.position = exitPosition.transform.position;
m_Body.transform.rotation = exitPosition.transform.rotation;
m_Body.gameObject.SetActive (true);
}
//RFPS Camera
m_MainCamera.GetComponent<Camera>().enabled = true;
m_MainCamera.GetComponent<AudioListener> ().enabled = true;
m_WeaponObj.SetActive (true);
m_WeaponCamera.GetComponent<Camera> ().enabled = true;
//Vehicle Camera
vehicleCamera.GetComponentInChildren<Camera> (true).enabled = false;
vehicleCamera.GetComponentInChildren<AudioListener> (true).enabled = false;
//EDYS
m_VehicleController.throttleInput = 0.0f;
m_VehicleController.brakeInput = 1.0f;
m_VehicleStandardInput.enabled = false;
m_VehicleCameraController.enabled = false;
}
//User EVP Functionality
void UpdateEVPCameraSettings()
{
m_VehicleCameraController.target = m_Target;
m_VehicleCameraController.ResetCamera();
}
}
}
Re: Realistic fps prefab tenho esses erros ao tentar colocar um script de entrar sair do carro
Boa tarde! no link do Asset (https://assetstore.unity.com/packages/templates/systems/realistic-fps-prefab-7739) você pode ir até Support e verificar diretamente com o desenvolvedor do mesmo, afinal você comprou o Asset tem todo o direito do suporte, e ninguém melhor para te ajudar que o próprio desenvolvedor.
Abraço!
Abraço!
Re: Realistic fps prefab tenho esses erros ao tentar colocar um script de entrar sair do carro
dstaroski escreveu:Boa tarde! no link do Asset (https://assetstore.unity.com/packages/templates/systems/realistic-fps-prefab-7739) você pode ir até Support e verificar diretamente com o desenvolvedor do mesmo, afinal você comprou o Asset tem todo o direito do suporte, e ninguém melhor para te ajudar que o próprio desenvolvedor.
Abraço!
como você pode ver na imagen acima,eu ja entrei no suporte
Re: Realistic fps prefab tenho esses erros ao tentar colocar um script de entrar sair do carro
Samuelostgamer escreveu:https://www.mediafire.com/view/bwci17q3iihpt82/Dwm_2018-10-11_14-58-41-97.bmp/filedstaroski escreveu:Boa tarde! no link do Asset (https://assetstore.unity.com/packages/templates/systems/realistic-fps-prefab-7739) você pode ir até Support e verificar diretamente com o desenvolvedor do mesmo, afinal você comprou o Asset tem todo o direito do suporte, e ninguém melhor para te ajudar que o próprio desenvolvedor.
Abraço!
como você pode ver na imagen acima,eu ja entrei no suporte
Tópicos semelhantes
» Entrar e sair do carro
» Alguém me ajuda a resolver esses 3 erros no meu script C# pf
» Como entrar e sair do carro usando o third person controller??
» Estou com esses erros no asset que eu comprei 'EventReference' 'FMOD'
» oque eu tenho que colocar nesse script?
» Alguém me ajuda a resolver esses 3 erros no meu script C# pf
» Como entrar e sair do carro usando o third person controller??
» Estou com esses erros no asset que eu comprei 'EventReference' 'FMOD'
» oque eu tenho que colocar nesse script?
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos