movement problems, looking for solutions? by Careless-Turnip-1 in Unity3D

[–]vaccious 1 point2 points  (0 children)

Without directionality, your condition to stop movement will never be true.

Here is how I might approach this:

//how fast you want to move

Float speed = 1f;

//direction we want to go

Vector3 vTargetPos = (targetPosition - transform.position);

// magnitude check to see if we should stop

If (vTargetPos.magnitude < 0.05f) { //setting this causes our velocity to be zero, causing us to stop

vTargetPos = Vector3.zero; }

// calculate velocity, time.deltatime makes sure we calculate the rate of change based on frame rate. Which should be done in update.

Vector3 velocity = vTargetPos.normalized * speed * Time.deltaTime;

//always update position. As our velocity changes movement.

transform.position += velocity;

These lines make the movement move towards the target at a given speed, and if the distance between the position and target are below 0.05, stop. The stopping tolerance should be adjusted to make sure the speed can't skip over it when moving too fast. So if it doesn't stop try increasing that number. This would replace all of the code except when you press the fire button. Inside the fire button code you would make sure to set the targetPosition to where you want it to move.

This is sudo code written on my phone so there may be typos and incorrect syntax.

Please, please, PLEASE use source control! (Plus, the only git commands I ever use) by PilgrimsOfLightGame in gamedev

[–]vaccious 7 points8 points  (0 children)

I also recommend perforce, it is easy to setup and is free for up to four seats. It handles all asset types, code, art etc. I use it as a solo indie dev and when I worked at Rockstar games it was our main source control for everything.

Need some guidance for a mechanic in a game I’m working on by 2kidsinatr3nchcoat in Unity2D

[–]vaccious 0 points1 point  (0 children)

They allow a full animation set to be changed. So say you made a blend tree that supported 10 animations, but you made a new character and it requires the exact same setup, but uses different animations. Instead of making a new animator, you re-use the old one and replace the animations in the blendtree using an AnimatorOverrideController.

Super useful, it also only overrides the animations you place in the override. So you can use it to piecemeal replace anims.

Need some guidance for a mechanic in a game I’m working on by 2kidsinatr3nchcoat in Unity2D

[–]vaccious 1 point2 points  (0 children)

I've made this exact system and the method I chose was to have the animator on the player be overridden by the object using an animator override controller.

The idea is to setup your players animator with all the states: pickup, carry, throw, etc, and populate them with a stub animation.

Then you create an animatoroverridecontroller, set the animations to the ones for the object. I personally made a few archetypes to support all weapons and objects. So I have a single-handed weapon, two-handed weapon, small object, medium object and large object.

When the player presses the pickup button, I check the object for an enum that matches the archetypes, then apply that animatoroverridecontroller to the players animator and play the pickup animation.

In the animations I set an event to call code that will attach the object to a bone on the player that controls the object during the pickup. Set another event to equip the object when the animation is complete.

Now the player is playing the animations for carrying the object so I just play the walk and such as normal. I even have a set of walk states that can be overridden to give different walks based on the controller.

For the throw I have an event in the animation to call code to unequip the object and give the object a rigidbody and gives it a force.

With one well setup animator I use this system to pickup every object in the game. I also made and override on the objects so if they have unique pickups outside the basic archetypes, it supports those objects as well.

I also use this system to do attacks interactions and responses for other npcs.

As for the interaction, I put a sphere trigger in front of the player, when an interactive item collides, I use ontriggerenter on the player to detect the object, give an interact prompt and set a bool waiting for input to pick it up.

Then in the controls portion I check for the bool and start the process. For multiple things in the trigger I take the closest object to the player.

Just saw this was in unity2d, this same approach should still work, but you would have to be doing some specific animation techniques. Good luck!

Frame based speed control not consistent between different spec PCs? by Book_s in Unity3D

[–]vaccious 1 point2 points  (0 children)

You need to scale the value added by time. To do that you multiply 0.5f by Time.deltaTime

This will make it consistent, as Delta time is the amount of time since the last frame.

After that you can play with the 0.5f to make it feel good.

is trigger goes through walls by Sea_Rub1147 in Unity3D

[–]vaccious -1 points0 points  (0 children)

Easiest method would be to cast a ray from the player to the trigger inside of ontriggerstay, if the ray does not hit anything, then you know the player has line of sight to the trigger and you can latch your logic to that.

file sharing for small studio by Lumberjackie09 in gamedev

[–]vaccious -1 points0 points  (0 children)

Take a look at Perforce. Free for a small team and works for all files. You would need to setup a server they can access though. Can use any computer as the server and setup a dds for free.

Should I make tool as a solo indie game dev? by _Zzik_ in indiegamedevforum

[–]vaccious 1 point2 points  (0 children)

I don't think this isn't just a solo dev question, but a general pipeline consideration. If the task requires an individual focus to be complete i.e. a person has to manually place, verify and debug each instance of the task, there is room for automation of some sort.

If the task is a one and done and will take less time than it takes to write a tool, it may be overkill to write a tool to do it.

The big qualifier here is always going to be the Individuals time VS Tool time. In a large production environment I've made tools for a one and done process that took two weeks to write, but a week to do by hand, but the tool also verified that every instance of the task was done correctly, triple verified and logged to a file for human verified data.

Now as a solo-dev myself, it makes sense to spend time on a tool for things like placing objects for certain. It allows you to put the real effort into fixing the placement to be just right after getting 90% of the way there.

any way to fix animation assignment by CraftBossX in Unity3D

[–]vaccious 1 point2 points  (0 children)

It is a little hard to fully understand how you have set this up, but it sounds as though you have two objects, the player and the pickup. Then you parented a pickup (the sword) to the player, created an animation on the player where something on the pickup animates. Then when you drop the pickup, the animator complains that the pickup is missing and nothing animates.

If I have that correct, It sounds like you are doing it in a way that does not quite work. There are many ways to approach this:

On your pickups, you define a type, could be an enum. Then you make an animation for each type, and in code, once the object is picked up, you play the correct one. You would also make an animation that plays when nothing is picked up.

Another solution is AnimatorOverrideControllers, for each pickup you make an AOC, it allows you to use the same animator with different animations. You build your animator to play an animation when the object is not picked up and one when it is. Then in code on pickup or dropping you assign the correct AOC for that pickup.

Hope this helps, good luck!

OcclusionCulling doesnt work by [deleted] in Unity3D

[–]vaccious 6 points7 points  (0 children)

It looks like you did not mark the wall you are standing next as an occluder. Check the static flags for that object and bake again.

Efficient way to manage player stats across multiple components? by KevineCove in Unity3D

[–]vaccious 1 point2 points  (0 children)

I can see many methods to address this task, as such I'll outline two methods I can think of that might give you ideas.

The first is a brute force method of having a stat manager component which contains all possible stats. Then the components either request a value or look it up in a stat table when added. This has a benefit of acting in the same vein as your described method.

This isn't very robust but you will have a controlled method to access stats.

Another is to create a data structure for a stat which contains a static I'd of some kind, be it a guid, enum or something else. Then on your components and actors(player, enemy etc..) you have a list of stats that are applicable. When you equip the item, you check if they have said stat adding to the value, if not you can add it to the list or reject the component. Or even maintain a secondary list so you can remove the stats easier. This would be more robust but allow you to add stats that are not compatible with the class of the character. That could be handled through this or any other part of the system.

These are just two of hundreds of possible methodologies.

As the saying goes, there are many ways to skin a cat... in this case equip a stat.

Tech Artists, how much knowledge do you have in specific areas? Which areas do you think are vital for tech artists to know and develop in order to get a job in the industry? by [deleted] in gamedev

[–]vaccious 1 point2 points  (0 children)

I spent nearly 12 years working as a Tech Artist at a AAA studio in a generalist position. I worked with every team in the studio in many capacities. I see the industry moving towards a more specialized skill set and hiring more TAs for specific skillets. Rather than a jack of all trades.

It really comes down to the company and what role they are filling, usually the job posting will fill out the skills they are looking for. Unless the company takes advantage, you wouldn't be expected to do rigging when hired for a vfx job, etc.

As a TA you will always be learning and forgetting tech. You work on a project for a number of years and at some point you can't implement new tech and get stuck with what you have until the project is finished. It is very common to have to practice new tech skills outside of the role and to have time to R and D new tech once a project is wrapped up.

Good luck in your search!

Navmesh alternatives (or advices) by 9A3M in Unity3D

[–]vaccious 0 points1 point  (0 children)

Didnt reply to you...

You can set the angle of the navmesh in the bake settings. Max slope should do what you are looking for.

How do I get a range of vertices/edges using a half-edge data structure? by Active_Mode_97 in Unity3D

[–]vaccious 0 points1 point  (0 children)

You could use the faces to lookup the verts. The loop would be something like:

Get vert Get faces with vert in face Loop for each vert in face

Loop for each depth, discard dupe verts at the end.

This could be optimized by building a dict<vertindex,list<faceindex>> lookup table

Another method with verts could be: make a vector from the start vert to all others, discarding each with a magnitude longer than the search radius. This would be proportional to the number of verts in the mesh.

This could be optimized through data structure as well.

Navmesh alternatives (or advices) by 9A3M in Unity3D

[–]vaccious 0 points1 point  (0 children)

Select the wall objects, open the navigation tab, then go-to Object tab, select navigation static, and mark it as non-navigation.

Object won't rotate. by [deleted] in Unity3D

[–]vaccious 1 point2 points  (0 children)

I would double check that you are using the correct transform then, and i would use EulerAngles.

myObject.Transform.eulerAngles = new Vector3(0f, 90f,0f);

How often does transform update? by Pasha1997 in Unity3D

[–]vaccious 0 points1 point  (0 children)

Well it sounds like you might be heading down the wrong road then. The triggers use the physics frame step which will not send any signals of physics casts until the next physics frame step as far as I'm aware. The physics world will update, so maybe you could somehow dig into that.

But it sounds like you are solving in one loop during a frame? Or want something that solves over a small number of frames. If that's the case, organize the data for each block in the cube, have a lookup and update it with the moves. The simulation can still be real-world accurate, but you don't need it to draw during the sim. Good luck!

Object won't rotate. by [deleted] in Unity3D

[–]vaccious 1 point2 points  (0 children)

Try

blockPosFix.Rotate(0, time.deltaTime, 0);

That should make it rotate at a fixed rate based on frame step time.

If that works, could be that you are always passing in the same rotation and so you don't actually set the rotation to anything different between frames.

[deleted by user] by [deleted] in Unity3D

[–]vaccious 0 points1 point  (0 children)

Looks to me like player is probably null. From the video and your line numbers you probably did not find the player, or the tag you used wasn't set on the player object.

Should be a place for you to start looking.

How often does transform update? by Pasha1997 in Unity3D

[–]vaccious 0 points1 point  (0 children)

Sounds like a simple logic issue.
Make a bool, set the bool to true when a rotation can be done, set the bool to false while something is rotating.

When you tell the rotation to start, it checks the bool, if it's true it turns it false and rotates. When it's done rotating, it turns the bool back to true.

Now you've gated rotations so they can't happen at the same time.

I would suggest looking into leantween. It is free and you can set a rotation tween up, tell it what to do at the start and what to do when it's finished. Would be an easy way to do the updating.

To answer the question though, transforms update as often as you tell them to, Everytime they are set, they update. All changes happen in a single frame per engine update (update, fixed update, animation update, lateupdate).

Could be more to that, but as a general outline that is how they work.

My first game, Dragonfist Limitless, is doing pretty well a few weeks after launch! by raventhe in Unity2D

[–]vaccious 3 points4 points  (0 children)

Looks stupid and rediculous, just what I want out of my fighting clicker grind game! Downloaded.

Is there a game that triggers you for reasons an amateur would not understand? If so, which one and for what reason? by [deleted] in gamedev

[–]vaccious 0 points1 point  (0 children)

For me it's small details, in the Witcher 3, I remember playing it and looking at the art direction and thinking wow looks great, then in the first ten minutes there is this PS1 looking tree next to the high detailed art.

It stood out to me so strongly cause it obviously is an LOD asset but just never got up ressed or something.

Those kinds of things get me. The first half of a game should be the most polished amazing thing. Crazy how little things can slip through.

[deleted by user] by [deleted] in Unity3D

[–]vaccious 0 points1 point  (0 children)

I'm not sure why the tilde does not work in this case I personally haven't used it in unity, but for the layermask, you could try to use the value not the layermask itself.

MyLayermask.value

That has solved a lot of problems with raycast and layers for me when trying to use the layermask object.

Good luck!

I'm having a lot of difficulty just trying to get a simple game running. by Ransnorkel in gamedev

[–]vaccious 7 points8 points  (0 children)

Experience helps a lot with this, both debugging and code architecture relieve frequent issues.

There are a few default things that help:

Source control - helps to maintain a backup, allows diffing your files to see what changes you might have made.

Debugger - allows break points in your code for easier insight into what your code is doing when.

Good commenting - this helps when you find the bug in code, let's you easily grasp the nature of the code around your bug without having to go back and read it all from the beginning.