Welcome to the Game Creator support forum!
This a place to ask questions, discuss ideas and report bugs. Please, provide your Unity and Game Creator versions as well as clear reproduction steps when opening a topic and full console logs.
I want to have a feature in my game where the Player auto-attacks, and the user can press a button to switch targets so that the Player will cycle through all nearby targets that are within a certain radius IN FRONT of the Player -- kind of like the Can See condition. I think I should use a List Variable with the Nearest with Tag Action and the lock-on Action in the coming Shooter Module, but I don't know what other Actions I can use to achieve this.
Excellent question. You're correct in using the Gather Action. Here's how I would do it:
Disclaimer: While preparing this example we noticed some missing features in version 1.0.1. This will be added in 1.0.2, which should be available tomorrow.
First of all, we need a Trigger to start cycling though the targets. We will be using a On Key Up Trigger with the Right Arrow key option. Now we need to call an Actions list that gathers game objects that should be targeted and cycles them each time this Action is executed.
We'll use the Gather Components By Distance action, which searches around a given radius all objects with a certain component. There are many ways to do this, but our approach would be creating an empty script used to identify which objects can be targeted. To do so, right click on the Project Panel and select Create -> C# Script and give it a name, like TargetableObject. Now drag and drop this script to some objects in your scene that you want to be able to target.
Back the Actions we're going to have the following:
- Gather Components by Distance: Fills a List Variables with a collection of targetable objects. In the Component field, type in "TargetableObject" and create a List Variable somewhere in order to fill it.
- Game Object Variable: Now that we have the list variable filled, we need to pick an object. This can be easily done using the Game Object variable and storing the selected game object from a list. To cycle between objects, make sure to use the Next option under the Select drop down. This is an iterator that cycles one step at a time through a list variables. You'll also need to create a Local Variable where to store the targeted object. In our case, we created one below the Actions and called it "target"
That's all! Every time you press the Right arrow you'll cycle through different objects that have the TargetableObject component.
You could also use the Trigger "On Variable Change" to detect when the "target" local variable changes and make the camera face whatever object is in "target".
Hope this helps. I'm attaching an image showcasing this.
I made an animation of an object moving, but it uses another animator controller. Is it possible to trigger the animation with an Action? Is there a better way to go about animating objects?
Ok, I got it to work by adding a trigger parameter in the animator and calling it with the Animate action. Let me know if there's a better way.
When I lower the Anchor Offset to less than 1 on the Z-axis, it seems to restrict the Player movement so that I can barely move diagonally. In this video, I was constantly trying to move diagonally: https://streamable.com/v4a18
This is a problem by design. How the directional movement works is by drawing an invisible line between the camera and the player. Then, using the plane of the floor it knows where forward, backwards, right and left are respective of the camera.
But if the camera is completely at the verticality of the Player, the precision of the floating point operations will make the Player confuse right with left and up with down.
To solve this issue, make the camera slightly tilted, so it's not right on top of the player, but a bit on one side. Also, try disabling the Look At, changing it to "Current Direction". Otherwise, the damping of the camera might give lead to the same problem you initially have.
Can the size of the toolbar be increased.
Eyes are going ;)
The toolbar uses the standard Unity size, which is 16 pixels high. I believe that in 2019.3 they will change it to 18 pixels, so we'll automatically update to it when 2019.4 LTS comes out :-)
Got an issue with this boolean not being recognised on starting the game. Wasn't a problem until the last update.
Hi Janus. Took a while, but I think I know where the problem is. First of all, the first console log that says "Set Visibility" is a log that shouldn't be there, and I'll make sure to remove it on the next update :-)
Secondly, the name of the variable is RainOn/Off. Local Variable names use the reserved character "/" to access nested variables. For example, if you have a Game Object variable called A that points to an object with another Local Variable called B, you can access B by accessing the variable name: A/B (like if they where folders).
So the solution would be to change the name of the variable to something like Rain-On-Off. I'll make sure to forbid adding this character on the next update!
would it be possible to have an action that detects if the player/character fell from a certain height in order to take damage or die?
I'm marking this topic as complete. It's already been implemented and will be available on version 1.0.2
I'm having some issues with the first person controller quickly rotating whenever i start a scene. It quickly acts as if the cam is turned the opposite way, and then quickly janks to the set view.
I have my acceleration and deceleration set at 300 which causes this: https://streamable.com/2a5gw
Is this a bug or am I supposed to use a lower acceleration/deceleration?
There are no problems in first person with model hidden though, which is mostly what I need high acceleration/deceleration for.
I'm marking this issue as fixed. We identified the problem as is going to be shipped with Game Creator version 1.0.2. Feel free to reopen if the problem persists afterwards.
How do I stop the character's head from turning like this: https://streamable.com/dvrn6
I don't know any game that does this.
I'm closing this issue since it's been fixed in version 1.0.2, which should be available between today and tomorrow. I've increased the default speed at which the character will turn its head as well as increased the angle at which it will turn.
Got an issue with this and I need help - I can't set it up the trigger On Collision Enter with the Player being the other collider because that requires the prefab I want to instantiate being moved into the Scene...and if I do that, the instantiated object becomes a clone and the 'destroy on finish' destroys the original item and not the clone.
I've even gone as far as to add a capsule collider trigger to the object I want to instantiate in case it was something to do with the object having a mesh collider.
I need to be walked through this because I'm going to need this information for a lot of stuff :P
Check out the latest Game Creator version 1.0.1 (available on the Asset Store tomorrow). The Instantiate Action comes with an optional parameter that allows you to store the instance created in a Local, Global or List Variable.
You can then use it to destroy the instance, rather than the prefab ;-)
Customer support service by UserEcho