#Help pls
1 messages · Page 1 of 1 (latest)
So how far have you gone codewise? Anything we can look at?
I believe so- My instructor told me to download a toggle script to use on the placeholder human mesh
at one point i actually had it so colliding with the mesh disabled the dialogue window- I dont know why it doesnt occur anymore.
Can you show your code?
on the placeholder character attach a script with OnCollisionEnter(){}
If the character has a trigger already, you can use OnTriggerEnter on either it or the player character. That'll fire whenever a Rigidbody enters the trigger area
If it's a solid collider, the same but with OnCollisionEnter instead
using System.Collections;
public class ToggleObjectTrigger : MonoBehaviour
{
public GameObject Object;
public bool SetObject = false;
void OnTriggerEnter (Collider other)
{ //this is looking for another object with the tag "player"
if (other.gameObject.tag == "Player")
{
Object.SetActive(SetObject);
}
}
}```
Triggers will let the character pass through
This is my toggle script on my placeholder
Maybe you removed the player tag from your player object?
I doubt that- the controller still has the tag
collision will be like a car accident, and will simulate physics
do you get any errors?
Does either object have a Rigidbody on it?
And how are you moving your player? With physics or transform.position = ?
I have no idea- we were given a third person controller and havent touched it.
the trigger is meant for the interaction/dialogue zone, not an actual collision on the human to trigger the dialogue . . .
the player has a rigid body on it. the placeholder doesn't
if(collision.gameObject.tag == "Player")
{
Debug.Log("you hit me!");
}
}```
Originally I wanted the player to be able to simply walk up to the mesh and press an interact key like F or E to intitiate the dialogue, like In skyrim or any other game
But collision seems easier
if using trigger make sure it's checked as a trigger
Just put a Debug.Log("other"); in your OnTriggerEnter without any if statement to see, if it actually hits.
The Three Commandments of OnTriggerEnter:
- Thou shalt have a 3D collider on both objects
- Thou Shalt tick
isTriggeron at least one of them - Thou Shalt have a Rigidbody3D on at least one of them
ok then use the OnTriggerEnter loop
I don't know what that means, Sorry
rigidbody3d
I'm an art student
Rigidbody3D is just a normal Rigidbody
dont use the 2D one
So both actors need rigidbodies on them
hah, same path i took. art student to programmer . . .
It's being forced onto us
Never a bad thing to know the other side
This is a group project and im the only person willing to do this >_> but hey programming is cool
Absolutely
Putting the rigidbody on the placeholder npc made it dissapear (possibly fell through the map?)
that is likely, freeze it's position
Just untick use gravity?
sure
man, this couldn't be more true. my school didn't have any programming classes (all art), but we had to make a game for assignment . . .
Got it
So essentially I want this show conversation thing to appear when colliding with the white character- but right now it persists on the HUD
permanently
did you drag in the text gameobject to the inspector field for Object?
also instead of using SetObject bool, just pass in true for now
and disable the start conversation text gameobject in the hierarchy before you hit play
or actually set it before using it. before calling Object.SetActive(SetObject); Say SetObject = !SetObject
no thats not it
um no, the eyeball just disables the visibility
no the canvas, but the text element specifically
untick the text gameobject and you'll see it go grey in the hierarchy
that is the component
you want to disable the gameobject above that
and I would child the white background under the text as well
This is very confusing I'm sorry.
Kind of
or all of it?
if you want all of that to pop up, then add an empty as a parent to all of it and then disable it
it might, but I usually leave the canvas enabled and put a parent empty below the canvas and disable that
So just add an empty below that dialogue system empty?
just empty
haha it's okay
yes
Got it
I'm not sure what dialoguemanager does but we'll go with it
I was following a Brackeys tutorial
https://www.youtube.com/watch?v=_nRzoTzeyxU
Let’s make a Dialogue System that you can easily tweak to suit your game!
● Listen to the Podcast: http://bit.ly/2un4o0m
● Download the Project: http://bit.ly/2t45YYc
● Download the Font: http://www.dafont.com/6809-chargen.font
● Singleton: http://wiki.unity3d.com/index.php/Singleton
♥ Support Brackeys on Patreon: http://patreon.com/brackeys/...
It just contains a dialogue manager script
which I dont exactly know what it does either..
_>
I would drag the dialogue manager up above and put it at the same level as dialogue system parent empty
yeah perfect