Jump to content

Setting up crouching/sprinting from empty template project


Recommended Posts

How do you setup sprint and crouch animations on an empty template project? By default, if you set an animation name to certain predefined keywords like root, run, side, etc. Those animations are bound to default (no key), w or up arrow key, a or left arrow key etc and play when those keys are triggered in game. The manual says that sprint is tied by default to left shift and crouch to left control. However, just setting an animation to sprint_forward or crouch_forward does not by itself make it play when those keys are pressed. In fact, by default, the character will not even enter those modes at all, regardless of the animations, as the adjustments to the datablock settings for sprint and crouch speeds do not take effect either when those keys are used. What is necessary to do in order to setup sprint and crouch to work within a new, from scratch, empty template project?

Link to comment
Share on other sites

That is probably a complicated issue.

What exactly did you do? Did you write your player scripts, player datablock and player animation scripts from scratch or did you copy them over?

It is hard to tell where the issue is, without knowing your codebase.

My first assumption would be that you are confused by the way Torque does those player stats, since they are hard coded, you cannot really set an image state or animation from the scripts, thats not possible without engine modifications, but you are not supposed to do it like that anyway.

The engine does not set animations, it uses a state machine to define in which state a player or weapon is, the animation is just optional, you can set which animation to play in the state machine, but the player also works without animations, including sprinting, crouching etc.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry if I made the question seem like I was doing something more complicated than I am. I built a project from an empty template. I did not add any scripts that are not specified in the empty template setup and I did not remove any scripts that were. I imported a model and set up the animations for the default state with root, run, side, etc. I think what I am trying to figure out how to trigger the switch into the sprint or crouch state mode since holding or tapping left shift and left control seem to have no effect on the animation or enact the configuration for sprint and crouch (speed, strafe, etc) as setup in the datablock.

Link to comment
Share on other sites

It is hard to debug, if we do not know what code you are actually using, maybe you could post it.

Otherwise I would advise to use the full template or at least copy over the working scripts which you need and then remove the stuff you do not want, it is easier that way around then to build from an empty template, the empty template is more for experienced users.

Apart from that you should keep in mind that the template system will be changed completely in the future and will be replaced by a module system, which is similar to your empty template, but you can add modular features such as a player. I would suggest trying out Torque 4.0 development and if you still cannot get your player to work, you can complain to the developers, so they can help you and eventually it will help getting version 4 more stable and usable.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...