#it seem as my script is running properly
1 messages · Page 1 of 1 (latest)
@sonic solar is there something preventing the animation to change and the gameObject to move?
why am i tagged in this tho
sorry
you seem to help a lot and maybe missed the question so i just added more context and tagged you so you will see
#📖┃code-of-conduct is against rules to tag anyone into questions
anyway Ill help this time but, refrain from doing it agian
you would have to start debugging the issue, its important to learn how to debug
I would start by checking if the logs are printing, if they are I would check the Animator for the object in question while selected in PlayMode
If you're seeing the animator is in the correct state, then move on finding out why the animations you put aren't moving
first im sorry I thought in this case it was ok
" @ or reply to people not in the conversation. Use common sense here, please."
lol not sure we were in any active convo prior buts its fine this time
and I printed the some logs and saw that the 'transform.position' ia reseting every 'Update' so it always stay put
that as well, changed to true
are u sure you referenced the correct animator? also which part would be the moving code?
double checked and the animation is ok (the default was the running animation apperantly and i forgett to animate the legs so thought it didnt update correctly)
but the position of the object didnt change
i printed the targetPosition and the transform.position and they werent close so it should have moved it ):
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
use links
thanks for your patient haha
i have 9 years of experience as full-stack (JS/TS) but im new at C# and unity
what are the values inside inspector for those vars
minX, minxY etc.
put Debug.Log after
targetPosition = new Vector2(randonX, randonY);
Debug.Log(targetPosition)
btw this is the same function as print
cool
only difference print doesn't work outside Monobehavior classes
which logs are those , so its moving?
from lines 28 and 30
https://gdl.space/cotibefosi.cs
its as it tries to move but on the next frame it start from the same position
there for not moving at all
but on the view i dont see any movment from the position
are you selecting the correct object in playmode
screenshot it in playmode
whole scene no crop
what do you mean?
the screenshot you sent earlier is a prefab
you would not see any values change if you havent selected the spawned instance in the scene / hierarchy
its the active one
wait..
where is speed
how do you not have a compiler error/underlined red in editor
oh why is it not in the script you sent
ohh this is an inherted class just noticed
and you can see from the logs it does advances a littttle towards the target but on the next frame when i print the position it the same as it was at the begining
yeah it keeps starting the movetowards from the beginning
have you tried without the animator ?
same
it just stay at the idle animation but not moving
wait wdym 2?
no but on the gameobject
wait how many script does enemy have
only thing I can think it can be maybe is somehow your Time was Timescale 0 or something
but we can see it did go farward every Update, but for some reason strarted from the original position on the next frame
there might be any colision?
just tested it
script is fine
Might be the rigidbody
although transform.position should override it
yeah no I put a rigidbody and its fine
something on your end isn't correct
no collision ):
Debug.Log("Collision Detected with: " + collision.gameObject.name);
}
darn this is hard haha
try putting this script on new plain box
is it working
yes!!!!!
yeah something is up with that one but Im not seeing anything obvious from here
ill try to recreate the prefab
you didnt mark the summoner as static by any chance?
omg it is
aghhh
oh ok
yeah looks fine
was happy for a sec hahaha
ok ill have to retry it all
ill let you know (;
thanks a lot for all the help!
no prob! goodluck 🫡
it has something to do with my animation controller
what exactly ?
unless you unimated the transforms o
but I did asked if it still was broken when you disabled animator
maybe, im testing it now
i thought i tested it but i guess i was wrong
i think i have a clue!
i might animated the container of all the parts instead of the body
not sure how to check it though
open the animation clip
ok its working with the animation now